returnHome is set to false by default, this keeps the lavalamp where you last clicked. The absolute home position (in relation to the parent UL) and size is set up via homeLeft, homeTop, homeWidth and homeHeight. Clicking the link below the menu will tell the lavalamp to move back to the home position, but does not change the selectedLava class.
$('#returnHomeDemo').lavaLamp({
fx: 'easeIn',
speed: 800,
homeTop:-1,
homeLeft:-1
});
ET, go home! $('#spaceshipHomeDemo li.homeLava').mouseover()startItem: 1 defaults to the 2nd menu element upon page load; menu arrays start with index of 0.
$("#bgImageStartItemDemo").lavaLamp({
fx: 'easeOut',
speed: 800,
startItem: 1
});
returnDelay is set to 1000 milliseconds; 1 second. The returnDelay starts counting down after the last move animation is completed, or returnDelay + speed. Because of this, the timing is not perfect with this method.
$('#returnDelayDemo').lavaLamp({
fx: 'easeInOut',
speed: 1000,
returnDelay:1000
});
click function just returns false: links will not activate when clicked; watch your address bar for verification. setOnClick is set to false, so clicking will not set new element as default return.
$("#clickVerticalDemo").lavaLamp({
fx: 'easeOut',
speed: 1000,
click: function() {return false;},
setOnClick: false
});
autoReturn is set to false, whatever menu item the mouse pointer was last over keeps the hover
$('#baseBallImageDemo').lavaLamp({
fx: 'easeInOut',
speed: 1000,
autoReturn: false
});
Click to Return to last selected $('#baseBallImageDemo li.selectedLava').mouseover()returnHome is true, telling lavalamp to return to the home position, even if a menu item is clicked. homeLeft, homeTop, homeWidth and homeHeight settings create the appropriate starting point, which is a shape larger than the parent ul for effect. overflow: hidden on ul is necessary CSS for this effect to work.
$('#homingDemo').lavaLamp({
fx: 'easeIn',
speed: 1000,
returnHome:true,
homeLeft: -100,
homeTop: -25,
homeWidth:700,
homeHeight:10
});
noLava class to skip highlighting applicable elements. The first example the 'Anchovies' list item is set with the 'noLava' class. A sub-list is contained within the list-item as a demonstration that the sub-list li elements still respond to the hover events.target and container options to target sub-elements for hover effect. Be sure to use the appropriate container to match the parent container; li elements for ul or ol parents, dd or dt elements for dl parents, p or div for div parents, span for p parents, et cetera. This embeds the sub-ul container in the same li as the parent li. This seems to be how most CMS software like Wordpress and Joomla are creating their menus, so we must target and style the link sub-element to float the hover correctly also using includeMargins to demonstrate effect.noLava class example,ul Anchovies sub-list
$('#multiLayerDemo').lavaLamp({
fx: 'easeIn',
speed: 500
});
Pizza Toppings
Pasta Blend
includeMargins
$('#multiLayerDemo').lavaLamp({
target: 'li > a',
container: 'li',
includeMargins: true,
fx: 'easeIn',
speed: 500
});
Pizza Toppings
Pasta Blend
dl (definition list) and dd sub-elements as lavaLamp hover containers, but targets the a element within for each hover element.div.
$('#callbackDemo').lavaLamp({
target: 'dd > a',
container: 'dd,
fx: 'easeIn',
speed: 500,
hoverStart: function() {
var time = new Date();
var timestring = time.getHours()+':'+time.getMinutes()+':'+time.getSeconds()+'.'+time.getMilliseconds();
$('#callbackLog').prepend('<p>Hover START to target at '+timestring+'</p>');
},
hoverFinish: function() {
var time = new Date();
var timestring = time.getHours()+':'+time.getMinutes()+':'+time.getSeconds()+'.'+time.getMilliseconds();
$('#callbackLog').prepend('<p>Hover FINISH to target at '+timestring+'</p>');
},
returnStart: function() {
var time = new Date();
var timestring = time.getHours()+':'+time.getMinutes()+':'+time.getSeconds()+'.'+time.getMilliseconds();
$('#callbackLog').prepend('<p>Return START to home at '+timestring+'</p>');
},
returnFinish: function() {
var time = new Date();
var timestring = time.getHours()+':'+time.getMinutes()+':'+time.getSeconds()+'.'+time.getMilliseconds();
$('#callbackLog').prepend('<p>Return FINISH to home at '+timestring+'</p>');
}
});
return to the jQuery LavaLamp Demos Page