- This topic is empty.
-
AuthorPosts
-
December 9, 2009 at 2:44 am #27137
BLUEBIRD
MemberHey, anyone got some ideas?
I have moved a static site into WordPress, adding an additional page for posts.
I had javascript on the original site and it all worked when I moved it across.
Now some of the javascript is working, others not. This was kind of sudden as it was all working yesterday.
I was trying to get a pageloader to work, couldn’t. But I am pretty sure I have removed all traces of that.I am not sure what I am doing wrong. I think it might be something to do with including some of the code in the head?
Here is my header code:Code:
>
var $j = jQuery.noConflict();
$j(function(){
$j("#sidebar li a").hover(function(){ $j(this).stop().animate({ paddingLeft: "20px&" }, 400); }, function() { $j(this).stop().animate({ paddingLeft: 0 }, 400); });
});
/*********************************************** * Ultimate Fade In Slideshow v2.0- (c) Dynamic Drive DHTML code library (http://www.dynamicdrive.com) * This notice MUST stay intact for legal use * Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more ***********************************************/
var mygallery=new fadeSlideShow({ wrapperid: "fadeshow1", //ID of blank DIV on page to house Slideshow dimensions: [824, 411], //width/height of gallery in pixels. Should reflect dimensions of largest image imagearray: [ ["/images/slide1.jpg"], ["/images/slide2.jpg"], ["/images/slide3.jpg"], ["/images/slide4.jpg"], ["/images/slide5.jpg"], ["/images/slide8.jpg"], ["/images/slide6.jpg"] //no trailing comma after very last image element! ], displaymode: {type:'auto', pause:2500, cycles:0, wraparound:false}, persist: false, //remember last viewed slide and recall within same session? fadeduration: 500, //transition duration (milliseconds) descreveal: "ondemand", togglerid: "" })
You don’t have the wp_head(); tag… The wp_enqeue_script("jquery"); just says "Make sure to include Jquery when you spit out the wp_head… but you still need to put this code after that:
If you are still having trouble, after that:
Enable Firebug and tell me what error you are getting.
If you are getting the "$ is not a function error" you are having the exact same problem I am.
My "band-aid solution" is to include JQuery again after my wp_head():
I’ll probably have to post my own topic about it soon…
Thanks Ashton,
I ended up using your ‘bandaid’ solution before I read the post.
It worked, but I will return to the project and try the other option.
I would like to do best practice if I can.
Thanks for the reply though,
BLUEBIRD
Yea… just for emphasis:
If you have any plugins that need something in the head area (SEO, JS, etc.), that wp_head function is what does it. So not having that in the head will be the easiest way to break a plugin ;)
- The forum ‘Back End’ is closed to new topics and replies.