This is a message.

Forum user: rokit

Basic information

Registered Nov 21, 2011
Last login Nov 21, 2011
Forum posts 2
Direct URL http://www.flowplayer.org/forum/users/117337

Latest forum posts

Posts:

Registered:

» » » » Re-bind overlay bindings after AJAX call

Posted: Nov 23, 2011

Figured out what the problem was. I was displaying an outside html page in the overlay and in that page was another call to the jquery library.

<script type="text/javascript" src="jquery/jquery-1.7.js"></script>

After commenting this line and jquery ui just to be safe it worked beautifully. I also replaced the live() function with on() since I'm using 1.7. So here is how the function looks, called in $(document).ready:
$("#employeesTable").on("mouseover", "a", function(event) {
		$(this).overlay({
			mask: "white",
			effect: "apple",
				 
			onBeforeLoad: function() {
				// grab wrapper element inside content
				var wrap = this.getOverlay().find(".contentWrap");
				// load the page specified in the trigger
				wrap.load(this.getTrigger().attr("href"));
			}
		});

Now, I can do as many searches as I need and the overlay will open every time. Hope this helps someone cause it took me about 2 days to figure it out.

Posts:

Registered:

» » » Re-bind overlay bindings after AJAX call

Posted: Nov 21, 2011

Nothing I've tried in this thread works. My current version looks like this, which is called in $(document).ready:

$("#employeesTable").live('mouseover', 'a[rel]', function (event) {
     $(event.data).overlay({
          mask: 'white',
	  effect: 'apple',
			 
	  onBeforeLoad: function() {
		// grab wrapper element inside content
		var wrap = this.getOverlay().find(".contentWrap");
		// load the page specified in the trigger
		wrap.load(this.getTrigger().attr("href"));
	  }
     });
});	

The employeesTable can be updated if a user does a search. I thought it only worked when the page first loaded, but one interesting fact is that you can conduct as many searches as you want before actually clicking on a name. Once you click on a name, forget about doing another search because the overlay won't appear again. There's got to be an easy fix for this, but I've already spent 5-6 hours trying to figure it out.