Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[ASK] jQuery w3schools
#1
akang2 sekalian,,gini sy liat script jQuery d w3schools trus sy modivikasi dikit..

sy tambahkan kondisi,, jadi padaa saat button awal di tekan kotak hijau akan membesar,, trus tekan berikutx kotak hijau kembali ke ukuran semula,, dan terus berulang ketika di tekan lagi... rencax sih gitu.. Culas Culas

tapi alhasil,, kotak hijaux membesar nanti pada saat button d tekan u/ kudua kalix,, trus tekan selanjutx udah g' bisa kembali ke ukuran semula Bingung Bingung

mohon solusix akang2 sekalian... ini sy sertakan scriptx..

Code:
<!DOCTYPE html> <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"> </script> </head> <body> <button onclick="animation()">Start Animation</button> <div id="demo" style="background:#98bf21;height:30px;width:30px;position:absolute;"> </div> </body> <script> function animation() { var x= new Number; if (x=0){ x=0; $("button").click(function(){ $("#demo").animate({opacity:'0.5',width:'30px',height:'30px'},1000); }); } else { x=1; $("button").click(function(){ $("#demo").animate({opacity:'0.5',width:'500px',height:'500px'},1000); }); } } </script> </html>
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Online-offline_16 jquery input DCODE 0 26 09-26-2013, 04:54 PM
Last Post: DCODE
  PHP Get With JQUERY compLann 2 74 01-09-2012, 04:16 PM
Last Post: compLann

Forum Jump:


Users browsing this thread: 1 Guest(s)