Current time: 08-13-2020, 04:29 AM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with load times
09-11-2014, 01:59 AM
Post: #10
RE: Help with load times
Looking at the panels, it looks like each one has this chunk of script embedded:

Code:
jQuery(window).load(function(){
    Shadowbox.init();
    jQuery(".cx-featuredimage a").hover(function(){
        jQuery(this).parent().addClass("highlight",{duration:500});
        jQuery(this).find("img").stop().css("opacity",0.5);
        jQuery(this).closest("div").find(".zoomin").stop().css("opacity","1");
        jQuery(this).closest("div").find(".zoomin").css("margin-right",-1*(jQuery(this).find("img").width()/2));
        jQuery(this).closest("div").find(".zoomin").css("margin-top",jQuery(this).find("img").height()/2);
        jQuery(this).closest("div").find(".zoomin").css("margin-left",jQuery(this).find("img").width()/2);
    },function(){
        jQuery(this).closest("div").find(".zoomin").stop().css("opacity",0);
        jQuery(this).parent().removeClass("highlight",{duration:500});
        jQuery(this).find("img").stop().css("opacity",1);
    });
});

It looks like most of that code is handling the zoom-on-hover but the Shadowbox.init() might be the code that is triggering the actual display.

For starters, that chunk of code looks like it is generic and should not be attached to every single one of the posts. You probably only need it once. You also don't want to attch it to the window load event. If you change the jQuery(window).load to jQuery(document).ready it should display the panels a lot sooner.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Help with load times - Enduring Epilepsy - 08-26-2014, 02:35 PM
RE: Help with load times - ajm_76 - 09-04-2014, 05:26 AM
RE: Help with load times - ajm_76 - 09-09-2014, 12:41 AM
RE: Help with load times - pmeenan - 09-10-2014, 11:28 PM
RE: Help with load times - pmeenan - 09-11-2014, 12:58 AM
RE: Help with load times - pmeenan - 09-11-2014 01:59 AM
RE: Help with load times - pmeenan - 09-11-2014, 10:18 PM
RE: Help with load times - ajm_76 - 09-12-2014, 03:24 AM
RE: Help with load times - pmeenan - 09-12-2014, 12:09 AM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)