Jump to content
Fórum Script Brasil
  • 0

SÓ Vale CÓdigos


marcos_804
 Share

Question

8 answers to this question

Recommended Posts

  • 0

Se tiverem alguma dúvida ou problema me enviem um e-maio, serei grato em atendê-los

<head>

<script type="text/javascript">

var enablepersist="on" //Enable saving state of content structure using session cookies? (on/off)

var collapseprevious="no" //Collapse previously open content when opening present? (yes/no)

if (document.getElementById){

document.write('<style type="text/css">')

document.write('.switchcontent{display:none;}')

document.write('</style>')

}

function getElementbyClass(classname){

ccollect=new Array()

var inc=0

var alltags=document.all? document.all : document.getElementsByTagName("*")

for (i=0; i<alltags.length; i++){

if (alltags.className==classname)

ccollect[inc++]=alltags

}

}

function contractcontent(omit){

var inc=0

while (ccollect[inc]){

if (ccollect[inc].id!=omit)

ccollect[inc].style.display="none"

inc++

}

}

function expandcontent(cid){

if (typeof ccollect!="undefined"){

if (collapseprevious=="yes")

contractcontent(cid)

document.getElementById(cid).style.display=(document.getElementById(cid).style.display!="block")? "block" : "none"

}

}

function revivecontent(){

contractcontent("omitnothing")

selectedItem=getselectedItem()

selectedComponents=selectedItem.split("|")

for (i=0; i<selectedComponents.length-1; i++)

document.getElementById(selectedComponents).style.display="block"

}

function get_cookie(Name) {

var search = Name + "="

var returnvalue = "";

if (document.cookie.length > 0) {

offset = document.cookie.indexOf(search)

if (offset != -1) {

offset += search.length

end = document.cookie.indexOf(";", offset);

if (end == -1) end = document.cookie.length;

returnvalue=unescape(document.cookie.substring(offset, end))

}

}

return returnvalue;

}

function getselectedItem(){

if (get_cookie(window.location.pathname) != ""){

selectedItem=get_cookie(window.location.pathname)

return selectedItem

}

else

return ""

}

function saveswitchstate(){

var inc=0, selectedItem=""

while (ccollect[inc]){

if (ccollect[inc].style.display=="block")

selectedItem+=ccollect[inc].id+"|"

inc++

}

document.cookie=window.location.pathname+"="+selectedItem

}

function do_onload(){

uniqueidn=window.location.pathname+"firsttimeload"

getElementbyClass("switchcontent")

if (enablepersist=="on" && typeof ccollect!="undefined"){

document.cookie=(get_cookie(uniqueidn)=="")? uniqueidn+"=1" : uniqueidn+"=0"

firsttimeload=(get_cookie(uniqueidn)==1)? 1 : 0 //check if this is 1st page load

if (!firsttimeload)

revivecontent()

}

}

if (window.addEventListener)

window.addEventListener("load", do_onload, false)

else if (window.attachEvent)

window.attachEvent("onload", do_onload)

else if (document.getElementById)

window.onload=do_onload

if (enablepersist=="on" && document.getElementById)

window.onunload=saveswitchstate

</script>

</head>

<body>

<h3 onClick="expandcontent('sc1')" style="cursor:hand; cursor:pointer">Clique aqui e um texto vai abrir abaixo.</h3>

<div id="sc1" class="switchcontent">

JavaScript is a scripting language originally developed by Netscape to add interactivity and power to web documents. It is purely client side, and runs completely on the client's browser and computer.

</div>

<h3 onClick="expandcontent('sc2')" style="cursor:hand; cursor:pointer">Difference betwen Java & JavaScript?</h3>

<div id="sc2" class="switchcontent">

Java is completely different from JavaScript- the former is a compiled language while the later is a scripting language.

</div>

<h3 onClick="expandcontent('sc3')" style="cursor:hand; cursor:pointer">What is DHTML?</h3>

<div id="sc3" class="switchcontent">

DHTML is the embodiment of a combination of technologies- JavaScript, CSS, and HTML. Through them a new level of interactivity is possible for the end user experience.

</div>

<h3 onClick="expandcontent('sc4')" style="cursor:hand; cursor:pointer">What is DHTML?</h3>

<div id="sc4" class="switchcontent">

DHTML is the embodiment of a combination of technologies- JavaScript, CSS, and HTML. Through them a new level of interactivity is possible for the end user experience.

</div>

</body>

Link to comment
Share on other sites

  • 0

ESTE É UM ÓTIOMO SCRIPT PARA QUEM QUER CRIAR UMA PÁGINA QUE TENHA FOTOS INTERATIVAS

ISSO VAI NO <HEAD></HEAD>

<script type="text/javascript">

//Specify image paths and optional link (set link to "" for no link):

var dynimages=new Array()

dynimages[0]=["http://www.dynamicdrive.com/dynamicindex14/photo2.jpg", "Coloqeu o link aqui"]

dynimages[1]=["http://www.dynamicdrive.com/dynamicindex14/photo1.jpg", "Coloqeu o link aqui"]

dynimages[2]=["http://www.dynamicdrive.com/dynamicindex4/thumb3.jpg", "Coloqeu o link aqui"]

//Preload images ("yes" or "no"):

var preloadimg="no"

//Set optional link target to be added to all images with a link:

var optlinktarget=""

//Set image border width

var imgborderwidth=0

//Optionally, change 1.0 and 0.7 below to affect Wipe gradient size and duration in seconds in IE5.5+:

var filterstring="progid:DXImageTransform.Microsoft.GradientWipe(GradientSize=1.0 Duration=0.7)"

///////No need to edit beyond here/////

if (preloadimg=="yes"){

for (x=0; x<dynimages.length; x++){

var myimage=new Image()

myimage.src=dynimages[x][0]

}

}

function returnimgcode(theimg){

var imghtml=""

if (theimg[1]!="")

imghtml='<a href="'+theimg[1]+'" target="'+optlinktarget+'">'

imghtml+='<img src="'+theimg[0]+'" border="'+imgborderwidth+'">'

if (theimg[1]!="")

imghtml+='</a>'

return imghtml

}

function modifyimage(loadarea, imgindex){

if (document.getElementById){

var imgobj=document.getElementById(loadarea)

if (imgobj.filters && window.createPopup){

imgobj.style.filter=filterstring

imgobj.filters[0].Apply()

}

imgobj.innerHTML=returnimgcode(dynimages[imgindex])

if (imgobj.filters && window.createPopup)

imgobj.filters[0].Play()

return false

}

}

</script>

ISSO VAI NO BODY

<b><font color="#000000">PASSE O MOUSE SOBRE A IMAGEM</font></b>

<p>

<a href="#" onMouseover="modifyimage('dynloadarea', 0)"><img src="http://www.dynamicdrive.com/dynamicindex4/thumb1.jpg" width="50" height="50"></a><br>

<a href="#" onMouseover="modifyimage('dynloadarea', 1)">image 2 (onmouseover)</a><br>

<a href="#" onClick="return modifyimage('dynloadarea2', 2)">image 3 (onclick)</a></p>

<p>

<div id="dynloadarea" style="width: 80; height: 225; position: absolute; left: 191; top: 68"></div>

<div id="dynloadarea2" style="width: 78; height: 62; position: absolute; left: 16; top: 166"></div>

Link to comment
Share on other sites

  • 0
Olá galera eu cheguei para deronar, venho trasendo vários scripts para vocês.

e aí começa um.

ESTE SCRIPT MUDA A IMAGEM CADA VEZ QUE UMA PESSOA ENTRA NO SITE, ASSIM ELE PODE FICAR MAIS DINAMICO.

QUALQUER DÚVIDA ME ESCREVAM:[email protected]

ISSO VAI NO <BODY></BODY>

<script language="JavaScript">

<!--

function random_imglink(){

var myimages=new Array()

//Especifique, onde tem IMAGEM a sua imagem, não se esqueça das aspas

myimages[1]="IMAGEM1"

myimages[2]="IMAGEM"

myimages[3]="IMAGEM"

myimages[4]="IMAGEM"

myimages[5]="IMAGEM"

myimages[6]="IMAGEM"

var ry=Math.floor(Math.random()*myimages.length)

if (ry==0)

ry=1

document.write('<img src="'+myimages[ry]+'" border=0>')

}

random_imglink()

//-->

</script>

<p align="center"><font face="arial" size="-2">This free script provided by</font><br>

<font face="arial, helvetica" size="-2"><a href="http://javascriptkit.com">JavaScript

Kit</a></font></p>

Link to comment
Share on other sites

  • 0

TRASIÇÃO DE IMAGENS SUPER MASSA

ISSO VAI NO BODY

<script type="text/javascript">

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

* Translucent Slideshow script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)

* This notice MUST stay intact for legal use

* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code

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

var trans_width='140px' //largura

var trans_height='225px' //altura

var pause=3000 //tempo de cada imagem(3000=3 seconds)

var degree=10 //velocidade de transição de 1 a 10.

var slideshowcontent=new Array()

//As ordens a seguir são o seguinte: [url DA IMAGEM, Link opicional, target do link, opicional]

slideshowcontent[0]=["photo1.jpg", "lINK DA IMAGEM 0", "_new"]

slideshowcontent[1]=["photo2.jpg", "", ""]

slideshowcontent[2]=["photo3.jpg", "http://www.google.com", ""]

////Não mexa aqui/////////////

var bgcolor='white'

var imageholder=new Array()

for (i=0;i<slideshowcontent.length;i++){

imageholder=new Image()

imageholder.src=slideshowcontent[0]

}

var ie4=document.all

var dom=document.getElementById&&navigator.userAgent.indexOf("Opera")==-1

if (ie4||dom)

document.write('<div style="position:relative;width:'+trans_width+';height:'+trans_height+';overflow:hidden"><div id="canvas0" style="position:absolute;background-color:'+bgcolor+';width:'+trans_width+';height:'+trans_height+';left:-'+trans_width+';filter:alpha(opacity=20);-moz-opacity:0.2;"></div><div id="canvas1" style="position:absolute;background-color:'+bgcolor+';width:'+trans_width+';height:'+trans_height+';left:-'+trans_width+';filter:alpha(opacity=20);-moz-opacity:0.2;"></div></div>')

else if (document.layers){

document.write('<ilayer id=tickernsmain visibility=hide width='+trans_width+' height='+trans_height+' bgColor='+bgcolor+'><layer id=tickernssub width='+trans_width+' height='+trans_height+' left=0 top=0>'+'<img src="'+slideshowcontent[0][0]+'"></layer></ilayer>')

}

var curpos=trans_width*(-1)

var curcanvas="canvas0"

var curindex=0

var nextindex=1

function getslidehtml(theslide){

var slidehtml=""

if (theslide[1]!="")

slidehtml='<a href="'+theslide[1]+'" target="'+theslide[2]+'">'

slidehtml+='<img src="'+theslide[0]+'" border="0">'

if (theslide[1]!="")

slidehtml+='</a>'

return slidehtml

}

function moveslide(){

if (curpos<0){

curpos=Math.min(curpos+degree,0)

tempobj.style.left=curpos+"px"

}

else{

clearInterval(dropslide)

if (crossobj.filters)

crossobj.filters.alpha.opacity=100

else if (crossobj.style.MozOpacity)

crossobj.style.MozOpacity=1

nextcanvas=(curcanvas=="canvas0")? "canvas0" : "canvas1"

tempobj=ie4? eval("document.all."+nextcanvas) : document.getElementById(nextcanvas)

tempobj.innerHTML=getslidehtml(slideshowcontent[curindex])

nextindex=(nextindex<slideshowcontent.length-1)? nextindex+1 : 0

setTimeout("rotateslide()",pause)

}

}

function rotateslide(){

if (ie4||dom){

resetit(curcanvas)

crossobj=tempobj=ie4? eval("document.all."+curcanvas) : document.getElementById(curcanvas)

crossobj.style.zIndex++

if (crossobj.filters)

document.all.canvas0.filters.alpha.opacity=document.all.canvas1.filters.alpha.opacity=20

else if (crossobj.style.MozOpacity)

document.getElementById("canvas0").style.MozOpacity=document.getElementById("canvas1").style.MozOpacity=0.2

var temp='setInterval("moveslide()",50)'

dropslide=eval(temp)

curcanvas=(curcanvas=="canvas0")? "canvas1" : "canvas0"

}

else if (document.layers){

crossobj.document.write(getslidehtml(slideshowcontent[curindex]))

crossobj.document.close()

}

curindex=(curindex<slideshowcontent.length-1)? curindex+1 : 0

}

function jumptoslide(which){

curindex=which

rotateslide()

}

function resetit(what){

curpos=parseInt(trans_width)*(-1)

var crossobj=ie4? eval("document.all."+what) : document.getElementById(what)

crossobj.style.left=curpos+"px"

}

function startit(){

crossobj=ie4? eval("document.all."+curcanvas) : dom? document.getElementById(curcanvas) : document.tickernsmain.document.tickernssub

if (ie4||dom){

crossobj.innerHTML=getslidehtml(slideshowcontent[curindex])

rotateslide()

}

else{

document.tickernsmain.visibility='show'

curindex++

setInterval("rotateslide()",pause)

}

}

if (window.addEventListener)

window.addEventListener("load", startit, false)

else if (window.attachEvent)

window.attachEvent("onload", startit)

else if (ie4||dom||document.layers)

window.onload=startit

</script>

<p align="center"><font face="arial" size="-2">This free script provided by</font><br>

<font face="arial, helvetica" size="-2"><a href="http://www.dynamicdrive.com">Dynamic Drive</a></font></p>

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share



  • Forum Statistics

    • Total Topics
      150.8k
    • Total Posts
      648.5k
×
×
  • Create New...