Help with a CSS Menu

  • 1
  • Question
  • Updated 7 years ago
  • Answered
Merged

This conversation has been merged. Please reference the main conversation: July Code Request

Hi guys,

I have been looking at a new menu system for my webpage instead of the usual boring ones and came across one I liked which I have revamped etc to get it the way I like and it works fine here : -http://getfitandshapeup2.yolasite.com but when I have it on this website its not doing what its supposed to : - http://blank77.yolasite.com. Anyone got any ideas why this aint working, is it a confliction of javascript or something to do with the coding which is the exact same on both pages??

Thanks for any advanced help on this its greatly appreciated.

Craig
Photo of Craig

Craig

  • 449 Posts
  • 11 Reply Likes

Posted 7 years ago

  • 1
Photo of Craig

Craig

  • 449 Posts
  • 11 Reply Likes
Anyone??
Photo of Laura Thomas

Laura Thomas, Social Media Coordinator

  • 4536 Posts
  • 211 Reply Likes
Hey Craig,

I'll merge your post here and see if Shawn can help you out!
Photo of Shawn Holman

Shawn Holman

  • 486 Posts
  • 26 Reply Likes
@Craig, the other post is now closed so please go here if this doesnt fix it:

----------

First Issue I see if that you are not actually loading the code that makes everytime happen. Not Sure why it works on the first but not on the second though.

First of all change:

$('.item').hover(function(){
var $this = $(this);
expand($this);
},
function(){
var $this = $(this);
collapse($this);
});


To:

$(document).ready(function(){
$('.item').hover(function(){
var $this = $(this);
expand($this);
},
function(){
var $this = $(this);
collapse($this);
});
});


Adding the document.ready method allows the code to be loaded rather then just sitting on the page.

This might not even be the issue though, so please try this and tell me if it worked or not.
Photo of Stefan

Stefan, Official Rep

  • 4448 Posts
  • 190 Reply Likes
Thank you so much for your continued fantastic help, Shawn!
Photo of Craig

Craig

  • 449 Posts
  • 11 Reply Likes
spot on shawn, works a treat now! thanks for your help, will know where to come for any coding problems lol

cheers

craig