I struggled with this same problem for hours! I just figured it out
this morning. If you download the uncompressed .js file for the
overlay tool you can see what's happening. In the 'constructor' for
the overlay, there is a w.load function that binds the click action
and initializes the rest of the overlay. However, on ajax success the
opportunity for the window.load function to be called has passed! In
order to make this work you need to strip that code out. In the
minimized version its a little harder to find. Essentially what you
need to do is look for the w.load(function(){ ........ {) (in the
uncompressed version).  Leave all the contents of the function, but
remove it from w.load.

Should put this as a note to the tools developers.... I'd call it a
bug?

On Aug 11, 1:21 pm, gabel <gabel.del...@googlemail.com> wrote:
> I use jQuery Tools and got a strange problem
>
> (jQuery Tools -->http://flowplayer.org/tools/index.html)
>
> HTML
> <code class="html">
>                 <button type="button" rel="#overlay" 
> id="overlaystatic">static</
> button>
>                 <button type="button" rel="#overlay" 
> id="overlaydynamic">dynamic</
> button>
> </code>
>
> Version where only the static overlay works
> <code class="javascript">
> $(document).ready(function(){
>
>         $("#overlaystatic").overlay({expose: '#6096D4'});
>
>         function createoverlay () {
>                  var datastring = "somedata";
>
>                  $.ajax({
>                            type: "POST",
>                            url: "check.php",
>                            data: "datastring =" + datastring ,
>                            success: function(msg){
>                                         alert(msg);
>                                         $("#overlaydynamic").overlay({expose: 
> '#6096D4'});
>                             }
>                 });
>
>         }
>
>         createoverlay();
>
> });
>
> </code>
>
> If I put the overloay code for the dynamicoverlay outside of the ajax
> it works fine
> <code class="javascript">
> $(document).ready(function(){
>
>         $("#overlaystatic").overlay({expose: '#6096D4'});
>
>         function createoverlay () {
>                  var datastring = "somedata";
>                  $.ajax({
>                            type: "POST",
>                            url: "check.php",
>                            data: "datastring =" + datastring ,
>                            success: function(msg){
>                                         alert(msg);
>
>                             }
>                 });
>
> $("#overlaydynamic").overlay({expose: '#6096D4'});
>
>         }
>
>         createoverlay();
>
> });
>
> </code>
>
> so why the line
> $("#overlaydynamic").overlay({expose: '#6096D4'});
> does work in the function but not inside the jquery ajax.

Reply via email to