jQuery mouseover and mouseleave do not work when logging out?
Permalink
This is a bit of a strange issue. My jQuery works fine in all regards, except for this bit:
If you mouse over this button, then the background slowly changes color. It works fine when logged in, but I'm testing my site when logged out and it stopped working.
Any ideas?
/*Home Button Hover Effect*/ $('.home-button-link').mouseover(function(){ $(this).animate({'background-color': '#3F74A9'},300); }); $('.home-button-link').mouseleave(function(){ $(this).animate({'background-color': '#5493c7'},300); });
If you mouse over this button, then the background slowly changes color. It works fine when logged in, but I'm testing my site when logged out and it stopped working.
Any ideas?
Check your developer console and see which jquery plugin needs to be required when logged out. There are a lot of things that are included when you are logged in that are not when you are logged out.
Howdy! Could you maybe guide me through it? I've opened the developer console on Chrome and I think it should be working, but I'm not 100% sure where to look.
Is this it?
http://i.imgur.com/s7SjBMD.png
Sorry for the amateur questions. =P
Edit: I've added the default.php and jQuary folder as an attachement. Incase that helps.
Is this it?
http://i.imgur.com/s7SjBMD.png
Sorry for the amateur questions. =P
Edit: I've added the default.php and jQuary folder as an attachement. Incase that helps.
On the left you should see a "tab" called Console, click on that and then try your hover and it will probably put up a red error with $()... function is not defined. Then you need to find which js file contains that function and make sure it's included in your theme/package/block.
Aha! So it does. I'm getting this error:
Uncaught TypeError: f.handler.apply is not a function.
This is my jQuery:
Have I made a mistake here? Like I said, it works fine when logged in.
Uncaught TypeError: f.handler.apply is not a function.
This is my jQuery:
/*Home Button Hover Effect*/ $('.home-button-link').mouseover(function(){ // When mousing over $(this).hover({'background-color': '#3F74A9'},300); }); $('.home-button-link').mouseleave(function(){ // When mouse leaves $(this).hover({'background-color': '#5493c7'},300); });
Have I made a mistake here? Like I said, it works fine when logged in.