How can i make JQuery buttons to impact an image style?
hello there
i hope can me jquery button issue - have tried find information need not find it, logically presented anywhere.
maybe give me direction on how work out following examle
1. have 2 buttons lets call them "but1" , "but2"
2. have 1 image - lets call "image.png"
3. depending button pressed want move image.png new absolute position on screen
i know how create 1 button or more - not know/understand how change style position of image based on button pressed
i hoping can complete code below fulfill above
$(document).ready(function(){
$("but1").click(function(){
$("p").css({"background-color":
"yellow " , "font-size": "200%"});
});
});
$(document).ready(function(){
$("but2").click(function(){
$("p").css({"background-color":
"red " , "font-size": "200%"});
});
});
thanks in advance;
stefan eng
the code provided triggering event handler <but1> , <but2> elements. doubt you're using elements <but1> , <but2>. more you'd have button identifier <button id="but2"> , use hash tag specify id of unique identifier example below.
$(document).ready(function(){ $("#but1").click(function(){ $("p").css({"background-color":"#ff0000", "font-size":"10px"}); $("img").css({"position":"absolute", "top":"100px", "left":"250px"}); }); $("#but2").click(function(){ $("p").css({"background-color":"#00ff00", "font-size":"30px"}); $("img").css({"position":"absolute", "top":"200px", "left":"50px"}); }); });
best,
shocker
More discussions in Dreamweaver support forum
adobe
Comments
Post a Comment