Jump to content

Jquery Ezjax help???


darkfreaks

Recommended Posts

so i am using this script to develop an inbox script it works fine until i click "go to next page" then when i click  message instead of loading a hidden div with options it loads a page with the hidden div content. can anyone figure this out?

 

ezjax.js

/*
* 
* jQuery EZJax v. 1.0.1
* http://www.thecreativeoutfit.com
* 
* 
*/

jQuery.fn.ezjax = function(o) {
  
  obj = jQuery(this).attr('class'); 
  
  // Defaults
  var o = jQuery.extend( {
    container: '#ezjax_content',
initial: null,
effect: null,
speed: 'normal',
easing: null,
bind: '.'+obj
  },o);
  
  // Load initial
  

  
  // Re-bind for any links internal to the content
  
function bind(){
	jQuery(o.container+' '+o.bind).ezjax({
		container: o.container,
		initial: null,
		effect: o.effect,
		speed: o.speed,
		easing: o.easing
	});
}
  
  // Main functionality
  
  return this.each(function() {
  
  	jQuery(this).click(function(){
	var url = jQuery(this).attr('href');

	// Check for transition effect

	if (o.effect != null) {

		// Run effect
		switch(o.effect){

			// Slide
			case 'slide':
			jQuery(o.container).animate({height:"0px"}, o.speed, function(){
				jQuery(o.container).css('overflow','hidden'); // Fix glitchies
				jQuery(o.container).load(url, function(){
					jQuery(o.container).animate({
						height: jQuery(o.container).children().height() + 20
					},o.speed,o.easing,function(){
						jQuery(o.container).css('overflow','visible'); // Undo glitchy fix
					});
					bind();
				});
			});
			break;

			// Fade
			case 'fade':
			jQuery(o.container).animate({ opacity: 0.0 }, o.speed, function(){
				jQuery(o.container).load(url, function(){
					jQuery(o.container).animate({ opacity: 1.0 }, o.speed);
					bind();
				});
			});
			break;
		}

	}
	else {
		// Standard load (no effect)
		jQuery(o.container).load(url,function(){
			bind();
		});
	}

	// Keeps the href from firing
	return false;

});
  
  });
  
};

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.