Edited by Wyatt, 15 August 2010 - 12:07 AM.
Need Help. Create Effects
Started by Wyatt, Aug 14 2010 02:22 PM
9 replies to this topic
#1
Posted 14 August 2010 - 02:22 PM
How can create rollover effects? Give me an example please. Would be very grateful for the assistance.
|
|
|
#2
Posted 15 August 2010 - 04:36 AM
rollover effects - Google Search
You may want to be more specific as to which effects you are talking about. There are CSS rollover effects, MooTools/jQuery effects, etc.
You may want to be more specific as to which effects you are talking about. There are CSS rollover effects, MooTools/jQuery effects, etc.
#3
Posted 16 August 2010 - 08:04 AM
How can I optimize the code.
Not to cause an anonymous function?
var item = document.getElementById(this.domElementId).childNodes;
for( var i = 0; i < item.length; i++ ) {
item[i].onmouseover = function() {
this.className = 'someClass';
}
item[i].onmouseover = function() {
this.className = '';
}
}
Not to cause an anonymous function?
#4
Guest_johnny.dacu_*
Posted 16 August 2010 - 08:25 AM
Guest_johnny.dacu_*
I think you need to assign onmouseout for one of those two. Now you assign the over event and then you rewrite it three lines bellow
#5
Posted 16 August 2010 - 09:04 AM
As an example you can show please, because I do not much understand your point.
#6
Guest_johnny.dacu_*
Posted 16 August 2010 - 09:05 AM
Guest_johnny.dacu_*
var item = document.getElementById(this.domElementId).childNodes;
for( var i = 0; i < item.length; i++ ) {
item[i].onmouseover = function() {
this.className = 'someClass';
}
[B]item[i].onmouseout = function[/B]() {
this.className = '';
}
}
Look at bold text
#7
Posted 16 August 2010 - 09:12 AM
What we accomplish by removing onmouseout?
Still under 100 elements will create 100 functions, and also we can not manipulate onmouseout which should be a logic...
Still under 100 elements will create 100 functions, and also we can not manipulate onmouseout which should be a logic...
#8
Guest_johnny.dacu_*
Posted 16 August 2010 - 09:15 AM
Guest_johnny.dacu_*
I haven't said you shoud remove onmouseout. Look at your code. You have declared "item[i].onmouseover = function() {" twice.
#9
Posted 16 August 2010 - 09:24 AM
I have for each element declared 2 events onmouseover, onmouseout.
So li onmouseover ='.......' onmouseout = '..........'
I can not understand what you mean....
Please give an example
So li onmouseover ='.......' onmouseout = '..........'
I can not understand what you mean....
Please give an example
#10
Posted 16 August 2010 - 10:21 AM
This implementation will be optimal than the previous ?
var element = null;
var handlerOnMouseOver = function() {
// some style
}
var handlerOnMouseOut = function() {
//some style ....
}
for( var i = 0; i < item.length; i++ ) {
element = item[i];
element.onmouseover = handlerOnMouseOver;
element.onmouseout = handlerOnMouseOut;
}


Sign In
Create Account

Back to top









