Lets say I had an element with multiple classes, one of these classes has a hover pseudo-class. Lets say this will change the colour.
So what I want to do is find out what colour the element will change to when hovered over. Then I want to override this with Javascript/jQuery.
The animateToSelector jQuery plug-in seems to do what you want.
I found that plug-in through another question on StackOverflow. Also have a look at this question to see there isn't really any other way to do it but by going through document.styleSheets.
Related
I'm writing a source code highlighter, and I'd like to highlight and make clickable a non-standard piece of code area.
For example, I'd like all the colored areas to be separately clickable.
As I understand it, implementing this with CSS is impossible. Though I can dynamically assign equal CSS classes to each span which belongs to same area (and modifying those via class selector). But then I have a problem, that each of those spans must be clickable. So I should also attach JS events to each span.
Overall this sounds like a zillion of spans with zillion of events, am I correct? Is there better solution?
I essentially need to have a user online click drag with the mouse or fingers on a picture of the human body to highlight the selected area red. Basically they're selecting areas of the body that hurt.
Then I need to store this information, and use it as needed.
Looking online I just seem to find how to highlight an area on hover like JQuery's maphighlight feature, which isn't what I want.
I'm very new to coding but am learning as I go along.
There are more pseudo-classes than hover. In this case, active or visited.
You could simply change the selected image section to a highlighted version of the same image.
Or add a border CSS property on :visited
To store information use either a made up data-[whatever] attribute,
or use a regular JavaScript variable. Since you'll need JavaScript to use the given variable anyways.
There are fancier solutions.
MAP is great for selecting shapes within an image, but doesn't have a way to highlight that selection.
I've been working on the Sequence slider from www.sequencejs.com. The slider is very intuitive but it can only do one kind of animation on an object, from what i've observed so far, here's how the slider works:
1.the html section consist of an unordered list which in turn have list-items
2.the js file edits the li's class to "animate-in" marking the rest of them "animate-out"
3.after 5s, the second li is marked "animate-in" and rest are marked "animate-out"
4.the css file uses the css3 transitions to animate classes when "animate-in" is triggered on that class
What i need?
I need to do multiple animations on one object. But not together, rather one after another, for instance, an image would slide in from the right; then scale up.
Maybe there's some way of doing it that i might not know, i would appreciate your help with that
Or, I was thinking if the javascript file could add more classes at certain times, I could get the effect. I went through the javascript but I'm not skilled enough to understand that yet.
Could you guys take a look at it and explain me which parts handle the class changing? How can I make it add more classes between "animate-in" and "animate-out"?
You can get the slider from here: sequencejs.com/slider-parallax/
Hope I was clear enough.
Creating a website using simple html(not html5) and css but got stock in mouseover effect. Need to show some text with background image when user mouseover a link. Following is an example..
NORMAL:
OVER:
I don't think it is possible to create the effect with simple CSS. My question is what is the most effective way to create the over effect and how? Javascript, DHTML or other language...
Thanks in advance...Rex...
Rex,
I think you would find jQuery very useful. jQuery is a javascript framework, very easy to use. www.jquery.com
You can achieve your effect with pure javascript, but again I think you will find using a javascript framework much easier, since your coming from actionscript.
For your particular instance I would make a div absolutely positioned. To show the div on mouseover you can use the jQuery $("#div_id").show(); and on mouseout use .hide();
Here is a basic tutorial for using show hide on events with jQuery.
http://www.learningjquery.com/2006/09/slicker-show-and-hide
Good luck!
You can use javascript to show a hidden div which is having text written inside it.
use javascript's onmouseover and onmouseout events to do this.
However have you tried using href:hover property of css to achieve this?
I am using this layover plugin to display content: http://jquery.com/demo/grey/ I know there must be a simple way to add a drop shadow border to the layover, similar to: http://fancybox.net/ but I can't figure out what the best method would be. Any suggestions?
Check out the liquidCanvas plugin. It makes it very easy to add drop-shadows (and other things like gradients and borders) to any element.
There is a full write-up and tutorial at http://www.caffeinedi.com/2009/11/02/using-jquery-and-liquidcanvas-to-add-drop-shadows-borders-rounded-corners-and-other-effects-to-your-website-even-in-ie6-and-ie7/