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.

jQuery selection

Featured Replies

Hi all,

 

I've decided to not use jQuery plugins and build my own gallery for my site.

To choose a picture there is a set of thumbnails, I want them all to have 0.5 opacity, then you hover over them they go up to 1.0.

 

So far I have this:

 

$("#thumbnail-rack img").fadeTo(300, 0.5); // Sets opacity to 0.5

$('#thumbnail-rack img').hover(function(){
$('#thumbnail-rack img').fadeTo(300, 1.0); // Sets the opacity to 100% on hover
},
			function(){
  	$('#thumbnail-rack img').fadeTo(300, 0.5); // Sets the opacity back to 50% on mouseout
				});

 

..which works but it works on all the images at the same time, not just the one being hovered over. The images do have their own ID's, so I could call it individually, but I'm sure there's a better way.

$("#thumbnail-rack img").fadeTo(300, 0.5); // Sets opacity to 0.5

       $('#thumbnail-rack img').hover(function(){
       $(this).fadeTo(300, 1.0); // Sets the opacity to 100% on hover
       },
                               function(){
       $(this).fadeTo(300, 0.5); // Sets the opacity back to 50% on mouseout
                                       });

  • Author

spot on thanks, knew there would be a really simple way to do it :D

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.