Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

probably quite simple jquery problem

Featured Replies

so I'm trying to get a simple jquery image rollover effect to work but it's only working on one of the photos atm

as you will see on here:

http://megamegamegamega.tumblr.com/

when you mouseover the first image you get the effect but it works on none of the other images.

 

this is the code I'm using (im fairly new to jquery so please don't judge)

$("#pix").mouseover(function() {
 $("#date").fadeIn("900", "linear");
});
$("#pix").mouseout(function() {
 $("#date").fadeOut("900", "linear");
});
$("#pix").mouseover(function() {
 $(this).animate({
   opacity: 0.9,
 }, 500, function() {
   // Animation complete.
 });
});
$("#pix").mouseout(function() {
 $(this).animate({
   opacity: 1,
 }, 500, function() {
   // Animation complete.
 });
});

 

thanks

Firstly, you are using id="date" & id="pix" multiple times in your html. They should be class= instead.

 

And in your jquery, you don't specify which 'date' to fade. You need to use something like $(this).siblings().fadeIn

Edited by Blofeld

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.