eolproductions Posted July 29, 2012 Share Posted July 29, 2012 (edited) Hi, I want to insert a pice of script into the header of my shop which will allow me to make my category block a accordion java block. The script that i am using is: <script type="text/javascript"> $(document).ready(function() { //slides the element with class "menu_body" when paragraph with class "menu_head" is clicked $("#firstpane p.menu_head").click(function() { $(this).css({backgroundImage:"url(less.gif)"}).next("div.menu_body").slideToggle(300).siblings("div.menu_body").slideUp("slow"); $(this).siblings().css({backgroundImage:"url(more.gif)"}); }); //slides the element with class "menu_body" when mouse is over the paragraph $("#secondpane p.menu_head").mouseover(function() { $(this).css({backgroundImage:"url(na.png)"}).next("div.menu_body").slideDown(500).siblings("div.menu_body").slideUp("slow"); $(this).siblings().css({backgroundImage:"url(left.png)"}); }); }); </script> I was reading about the {literal} tag but dont know what it really does. Thanks Edited July 29, 2012 by eolproductions (see edit history) Link to comment Share on other sites More sharing options...
Carolina Custom Designs Posted July 29, 2012 Share Posted July 29, 2012 It would be more appropriate to add the javascript to a new js file and then call the file in your header. Hope that helps! Marty Shue Link to comment Share on other sites More sharing options...
eolproductions Posted July 29, 2012 Author Share Posted July 29, 2012 (edited) Thanks. Iv done that. Edited July 29, 2012 by eolproductions (see edit history) Link to comment Share on other sites More sharing options...
Carolina Custom Designs Posted July 30, 2012 Share Posted July 30, 2012 You are welcome! Glad to hear you were able to get it to work. Marty Shue Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now