Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-08-2012, 06:13 AM   PM User | #1
Sniickerz
New Coder

 
Join Date: Oct 2010
Posts: 16
Thanks: 1
Thanked 0 Times in 0 Posts
Sniickerz is an unknown quantity at this point
jquery issue

is anyone here good with it?

i got this script on krissales.com that I'm working on. I've figured out the ajax hash tagging, it works perfectly. However I'm customizing the fade in, fade out **** and I got part of it working. it'll load the page twice, if you see what I mean. I just want it to load once, on fade in, and once on fade out, however it does it twice.

Does anyone know what the hell it is, that I'm doing wrong?

This is the code I have:

Code:
  function page_load($href) {
            if($href != undefined && $href.substring(0, 2) == '#/') {
         $('#content').load($href.substring(2)); // replace body the #content with loaded html
 
         $('#content').fadeOut('slow', function() {   
         $('#content').fadeIn('slow');
});
the full core is at:

http://www.krissales.com/_lib/_js/core.js
Sniickerz is offline   Reply With Quote
Old 11-08-2012, 02:41 PM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,635
Thanks: 4
Thanked 2,448 Times in 2,417 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
Not sure why you posted this in other server side issues. JS is completely client side.
Moving from Other server side languages / issues to javascript > javascript frameworks
Fou-Lu is offline   Reply With Quote
Old 11-08-2012, 04:48 PM   PM User | #3
Sniickerz
New Coder

 
Join Date: Oct 2010
Posts: 16
Thanks: 1
Thanked 0 Times in 0 Posts
Sniickerz is an unknown quantity at this point
still need help.

actually not anymore. I got it!

Code:
function page_load($href) {
  if($href != undefined && $href.substring(0, 2) == '#/') {
    // replace body the #content with loaded html
    $('#content').load($href.substring(2), function () {
      $('#content').hide().fadeIn('slow');
    });
  }
}

Last edited by Sniickerz; 11-08-2012 at 04:52 PM..
Sniickerz is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:48 PM.


Advertisement
Log in to turn off these ads.