انجمن‌های فارس وب

نسخه کامل: اسكريپت پخش 10 موزيك به صورت تصادفي در پشت زمينه
شما در حال بازدید از بایگانی ارسال های انجمن هستید این نسخه کامل نیست : برای مشاهده نسخه کامل اینجا کلیک کنید
با سلام . يعد از مدتي باز برگشتم

. امروز يك اسكريپت براي پخش 10 موزيك به صورت تصادفي در پشت زمينه به فرمت midi ميگذارم

اين كد را زير قسمت كد

<head>

قرار مي دهيد

<script>
<!--
//By Ehsansoft (http://www.Ehsansoft.net )
var sound1="1.mid"
var sound2="2.mid"
var sound3="3.mid"
var sound4="4.mid"
var sound5="5.mid"
var sound6="6.mid"
var sound7="7.mid"
var sound8="8.mid"
var sound9="9.mid"
var sound10="10.mid"
var x=Math.round(Math.random()*9)
if (x==0) x=sound1
else if (x==1) x=sound2
else if (x==2) x=sound3
else if (x==3) x=sound4
else if (x==4) x=sound5
else if (x==5) x=sound6
else if (x==6) x=sound7
else if (x==7) x=sound8
else if (x==8) x=sound9
else x=sound10
if (navigator.appName=="Microsoft Internet Explorer")
document.write('<bgsound src='+'"'+x+'"'+' loop="infinite">')
else
document.write('<embed src='+'"'+x+'"'+'hidden="true" border="0" width="20" height="20" autostart="true" loop="true">')
//-->
</script>

خونسرد

اين اسكريپت ساعت به صورت عكس هست كه هركسي خواست ميتونه عكس ها را براي خودش تغيير بده و استقاده كنه

كد اول را در زير كد

<Head>

قرار مي دهيم

<script type="text/javascript">

/**************************************** *******

* JavaScript Image Clock- by Ehsansoft
* Ehsansoft.net
* Visit Ehsansoft Team  at http://www.Ehsansoft.net

**************************************** *******/

var imageclock=new Object()
    //Enter path to clock digit images here, in order of 0-9, then "am/pm", then colon image:
    imageclock.digits=["http://esoft.persiangig.com/clockimg/c0.gif", "http://esoft.persiangig.com/clockimg/c1.gif", "http://esoft.persiangig.com/clockimg/c2.gif", "http://esoft.persiangig.com/clockimg/c3.gif", "http://esoft.persiangig.com/clockimg/c4.gif", "http://esoft.persiangig.com/clockimg/c5.gif", "http://esoft.persiangig.com/clockimg/c6.gif", "http://esoft.persiangig.com/clockimg/c7.gif", "http://esoft.persiangig.com/clockimg/c8.gif", "http://esoft.persiangig.com/clockimg/c9.gif", "http://esoft.persiangig.com/clockimg/cam.gif", "http://esoft.persiangig.com/clockimg/cpm.gif", "http://esoft.persiangig.com/clockimg/colon.gif"]
    imageclock.instances=0
    var preloadimages=[]
    for (var i=0; i<imageclock.digits.length; i++){ //preload images
        preloadimages[i]=new Image()
        preloadimages[i].src=imageclock.digits[i]
    }

    imageclock.imageHTML=function(timestring){ //return timestring (ie: 1:56:38) into string of images instead
        var sections=timestring.split(":")
        if (sections[0]=="0") //If hour field is 0 (aka 12 AM)
            sections[0]="12"
        else if (sections[0]>=13)
            sections[0]=sections[0]-12+""
        for (var i=0; i<sections.length; i++){
            if (sections[i].length==1)
                sections[i]='<img src="'+imageclock.digits[0]+'" />'+'<img src="'+imageclock.digits[parseInt(sections[i])]+'" />'
            else
                sections[i]='<img src="'+imageclock.digits[parseInt(sections[i].charAt(0))]+'" />'+'<img src="'+imageclock.digits[parseInt(sections[i].charAt(1))]+'" />'
        }
        return sections[0]+'<img src="'+imageclock.digits[12]+'" />'+sections[1]+'<img src="'+imageclock.digits[12]+'" />'+sections[2]
    }

    imageclock.display=function(){
        var clockinstance=this
        this.spanid="clockspan"+(imageclock.instances++)
        document.write('<span id="'+this.spanid+'"></span>')
        this.update()
        setInterval(function(){clockinstanc e.update()}, 1000)
    }

    imageclock.display.prototype.update=function(){
        var dateobj=new Date()
        var currenttime=dateobj.getHours()+":"+dateobj.getMinutes()+":"+dateobj.getSeconds() //create time string
        var currenttimeHTML=imageclock.imageHTML(currenttime)+'<img src="'+((dateobj.getHours()>=12)? imageclock.digits[11] : imageclock.digits[10])+'" />'
        document.getElementById(this.spanid).innerHTML=currenttimeHTML

    }


</script>


سپس اين كد را در قسمتي كه تمايل داريد ساعت نمايش داده شود وارد كنيد

<script type="text/javascript">

new imageclock.display()

</script>


خونسرد

يكي از دوستان ايميل زده بودن و اين كد را خواسته بودن كه امروز گذاشتم . اسكريپت نوار اطلاعات در بالاي صفحه


اين كد را در زير كد

<Head>

قرار دهيد
نمونه :‌ [ جهت مشاهده لينك عضو شويد ! ]

<style type="text/css">

#informationbar{
position: fixed;
left: 0;
width: 100%;
text-indent: 5px;
padding: 5px 0;
background-color: lightyellow;
border-bottom: 1px solid black;
font: bold 12px Verdana;
}

* html #informationbar{ /*IE6 hack*/
position: absolute;
width: expression(document.compatMode=="CSS1Compat"? document.documentElement.clientWidth+"px" : body.clientWidth+"px");
}

</style>

<script type="text/javascript">

/**************************************** *******

* Animated Information Bar- by Ehsansoft
* Ehsansoft Team
* Visit Ehsansoft Team  at http://www.Ehsansoft.net/

**************************************** *******/

function informationbar(){
    this.displayfreq="always"
    this.content='<a href="javascript:informationbar.close()"><img src="http://esoft.persiangig.com/image/close.gif" style="width: 14px; height: 14px; float: right; border: 0; margin-right: 5px" /></a>'
}

informationbar.prototype.setContent=function(data){
    this.content=this.content+data
    document.write('<div id="informationbar" style="top: -500px">'+this.content+'</div>')
}

informationbar.prototype.animatetoview=function(){
    var barinstance=this
    if (parseInt(this.barref.style.top)<0){
        this.barref.style.top=parseInt(this.barref.style.top)+5+"px"
        setTimeout(function(){barinstance.animatetoview()}, 50)
    }
    else{
        if (document.all && !window.XMLHttpRequest)
        this.barref.style.setExpression("top", 'document.compatMode=="CSS1Compat"? document.documentElement.scrollTop+"px" : body.scrollTop+"px"')
    else
        this.barref.style.top=0
    }
}

informationbar.close=function(){
    document.getElementById("informationbar").style.display="none"
    if (this.displayfreq=="session")
        document.cookie="infobarshown=1;path=/"
}

informationbar.prototype.setfrequency=function(type){
    this.displayfreq=type
}

informationbar.prototype.initialize=function(){
    if (this.displayfreq=="session" && document.cookie.indexOf("infobarshown")==-1 || this.displayfreq=="always"){
        this.barref=document.getElementById("informationbar")
        this.barheight=parseInt(this.barref.offsetHeight)
        this.barref.style.top=this.barheight*(-1)+"px"
        this.animatetoview()
    }
}

window.onunload=function(){
    this.barref=null
}

</script>


<script type="text/javascript">
<!--Invocation code-->

var infobar=new informationbar()
infobar.setContent('با تشكر از شما براي بازديد از سايت فارس وب. عضو نشديد  <a href="http://forum.farsweb.ir/member.php?action=register">هم اكنون عضو شويد</a>')
//infobar.setfrequency('session') //Uncomment this line to set information bar to only display once per browser session!
infobar.initialize()

</script>


و براي تغيير نوشته نوار قسمت نوشته هاي فارسي كد را تغيير دهيد

نمونه :‌ [ جهت مشاهده لينك عضو شويد ! ]

مرجع آدرس ها