1. مهمان گرامی، جهت ارسال پست، دانلود و سایر امکانات ویژه کاربران عضو، ثبت نام کنید.
    بستن اطلاعیه

حرکت لینک به صورت رندم و ورود به صفحه ای خاص

شروع موضوع توسط bargezard ‏3/7/12 در انجمن ابزار وبلاگ

  1. کاربر فوق حرفه ای

    تاریخ عضویت:
    ‏1/12/11
    ارسال ها:
    4,580
    تشکر شده:
    9,041
    امتیاز دستاورد:
    113
    جنسیت:
    مرد
    حرفه:
    Student
    این کد جاوا اسکریپت لینک از بالا به پایین حرکت میکند و به صفحه ای که به صورت تصادفی مشخص شده میرود​

    کد:
    <script>
    
    /*
    Wheel of links script
    By JavaScript Kit (http://javascripts.8k.com)
    Over 200+ free scripts here!
    */
    
    var count=0
    function dothis(){
    setTimeout("document.wheel.wheel2.selectedIndex =1000",100)
    setTimeout("document.wheel.wheel2.selectedIndex =count",200)
    setTimeout("document.wheel.wheel2.selectedIndex =1000",300)
    setTimeout("document.wheel.wheel2.selectedIndex =count",400)
    setTimeout("document.wheel.wheel2.selectedIndex =1000",500)
    setTimeout("document.wheel.wheel2.selectedIndex =count",600)
    setTimeout("window.location=document.wheel.wheel2.options[document.wheel.wheel2.selectedIndex].value",800)
    }
    
    function animate(){
    var countfinal=Math.round(Math.random()*(document.wheel.wheel2.length-1))
    document.wheel.wheel2.selectedIndex =count
    if (count==countfinal){
    dothis()
    return
    }
    if (count<document.wheel.wheel2.length)
    count++
    else
    count=0
    setTimeout("animate()",50)
    } 
    
    </script>
    
    
    <form method="POST" name="wheel">
      <div align="center"><center><p><select name="wheel2" size="8">
        <option value="http://javascripts.8k.com">javascripts.8k.com</option>
        <option value="http://www.cnn.com">CNN</option>
        <option value="http://www.news.com">News.com</option>
        <option value="http://www.techweb.com">Tech Web</option>
        <option value="http://www.freewarejava.com">Freewarejava.com</option>
        <option value="http://www.virtualis.com/vr/gchiang">Virtualis Web Hosting</option>
        <option value="http://www.geocities.com">Geocities</option>
        <option value="http://www.abcnews.com">ABCnews.com</option>
      </select></p>
      </center></div><div align="center"><center><p><input type="button" value="Spin wheel!"
      name="B1" onClick="animate()"></p>
      </center></div>
    </form>
    
    <p align="center"><font face="arial" size="-2">This free script provided by</font><br>
    <font face="arial, helvetica" size="-2"><a href="http://javascripts.8k.com">javascripts.8k.com</a></font></p>