Skip to main content

Home/ jquery/ Group items tagged hover

Rss Feed Group items tagged

Alexis Sgavel

jRumble | A jQuery Plugin That Rumbles Elements - 0 views

  •  
    jRumble is a jQuery plugin that rumbles, vibrates, shakes, and rotates any element you choose. It's great to use as a hover effect or a way to direct attention to an element. You can control the X, Y, and rotation range, the speed, and event trigger for the rumble.
pagetribe .

Working with jQuery, Part 2: Building tomorrow's Web applications today - 0 views

shared by pagetribe . on 17 Dec 08 - Cached
  • // In this example, each row in a table will get a red background when // the mouse moves over it and a white background when the mouse leaves. $("tr").hover(function(){ $(this).css("background","#0000ff"); }, function(){ $(this).css("background","#ffffff"); });
  • attr(name)
  • // will change the image source, and the image displayed on the page will change $("img").attr("src", "myimage.jpg");
  • ...5 more annotations...
  • // use the val() function to get the text inside the textfield
  • // change the background of every div to red $("div").css("backgroundColor", "#ff0000"); // - or - $("div").css("backgroundColor", "red"); // - or - $("div").css({backgroundColor: "#ff0000"}); // notice the braces and lack of quotes
  • see the problem with them
  • You would definitely not want to place style code into the JavaScript code if you can help it.
  • <img src="/images/space.gif" id="spacer" class="a b c" alt="blank"> // Calls to the attr() function will return the following $("#spacer").attr("src"); // will return "/images/space.gif" $("#spacer").attr("alt"); // will return "blank" // Similarly, you can access the ID in the same way $(img).each(function(){ $(this).attr("id"); // will return "spacer" });
1 - 5 of 5
Showing 20 items per page