JS Style Switcher for BG Images
- Started
- Last post
- 7 Responses
- noiseisthis0
use this instead http://pastebin.com/m716b9290
- struggling a bit here buddy...can I send you an email?BusterBoy
- noiseisthis0
flash:
import flash.external.ExternalInterface...
import flash.events.MouseEvent;trigger_mc.addEventListener(Mous... onTrigger);
function onTrigger(event:MouseEvent):void {
// the method that you want to call in javascript goes in the quotes
ExternalInterface.call("trigger...
}--------------------------------
javascript:
<script type="text/javascript">
$(window).load(function(){
$("#linky").mouseover(
trigger();
});
});function trigger() {
$('body').css("background-image... bg-pink.gif )");
return false;
}
</script>
- BusterBoy0
Thanks for everyone's help on this. The code that is working is below - it triggers on mouseover:
<script type="text/javascript">
$(window).load(function(){
$("#linky").mouseover(function...
$('body').css("background-image... bg-pink.gif )");
return false;
});
});Then the HTML trigger:
a href="#" id="linky">clicky</aJust wondering how I could accomlish the trigger from within flash?
- noiseisthis0
var bgList = ["http://src.to.bg.com.jpg", "http://src.to.bg2.com.jpg",...]
$(document).ready(function(){
$("body").css("background", bgList[i]);
$("#button").click(function(){
i++
if(i>bgList.length) i=0;
$("body").css("background", bgList[i]);
});
}you need to dl jquery to do this ^^^^
- acescence0
this should get you started..
http://culturekiller.com/qbeans/…
- BusterBoy
Can anyone recommend any JS style switchers that will change the bacground image dynamically without reloading the page? I've found a few that will change the BG colour of the page - not many change the BG image.
Thanks