Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

maktub

Telinha de noticias

Recommended Posts

Salve galera,

 

Estava procurando um tuto para produzir uma tela igual a do IG e a do Terra que fica rodando com as noticias, descobri que aquilo é actionscript do flash, mas não tem exemplos e tem que fazer na unha, bem achei um outro código bem legal parecido mas não é flash entrem nesse site: TELA ACTION MAS EM JAVA, o que quero fica abaixo do banner de 120x60 que tem um botão "próximo" que mostra as notícias, achei bem legal

 

Alguém sabe como faz aquilo, ou se tem algo parecido para baixar e adaptar?

 

grato

Compartilhar este post


Link para o post
Compartilhar em outros sites

Opa, achei um bem legal, a dúvida agora é como eu faço que os layers randomizem auomaticamente? Por exemplo, ir do 1 para o 2 do 2 para o 3 e fazer o loop

 

segue o código:

 

index.htm

 

<html><link rel="stylesheet" type="text/css" href="tabcontent.css" /><script type="text/javascript" src="tabcontent.js"></script><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252"><title>Tab 1</title></head><body><ul id="maintab" class="shadetabs"><li class=show><a href="#" rel="tcontent1">1</a></li><li><a href="#" rel="tcontent2">2</a></li><li><a href="#" rel="tcontent3">3</a></li><li><a href="#" rel="tcontent4">4</a></li><li><a href="http://www.dynamicdrive.com">5</a></li></ul><div class="tabcontentstyle" style="width: 181px; height: 159px"><div class=show id="tcontent1" class="tabcontent">Tab content 1 here<br/><a href="http://www.dynamicdrive.com">5</a><br/></div><div id="tcontent2" class="tabcontent">Tab content 2 here<br />Tab content 2 here<br /></div><div id="tcontent3" class="tabcontent">Tab content 3 here<br />Tab content 3 here<br /></div><div id="tcontent4" class="tabcontent">Tab content 4 here<br />Tab content 4 here<br /></form></div></div><script type="text/javascript">//Start Tab Content script for UL with id="maintab" Separate multiple ids each with a comma.initializetabcontent("maintab")</script></p></body></html>
tabcontent.js

 

//** Tab Content script- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)//** Last updated: June 29th, 06var enabletabpersistence=1 //enable tab persistence via session only cookies, so selected tab is remembered?////NO NEED TO EDIT BELOW////////////////////////var tabcontentIDs=new Object()function expandcontent(linkobj){var ulid=linkobj.parentNode.parentNode.id //id of UL elementvar ullist=document.getElementById(ulid).getElementsByTagName("li") //get list of LIs corresponding to the tab contentsfor (var i=0; i<ullist.length; i++){ullist[i].className=""  //deselect all tabsif (typeof tabcontentIDs[ulid][i]!="undefined") //if tab content within this array index exists (exception: More tabs than there are tab contents)document.getElementById(tabcontentIDs[ulid][i]).style.display="none" //hide all tab contents}linkobj.parentNode.className="selected"  //highlight currently clicked on tabdocument.getElementById(linkobj.getAttribute("rel")).style.display="block" //expand corresponding tab contentsaveselectedtabcontentid(ulid, linkobj.getAttribute("rel"))}function savetabcontentids(ulid, relattribute){// save ids of tab content divsif (typeof tabcontentIDs[ulid]=="undefined") //if this array doesn't exist yettabcontentIDs[ulid]=new Array()tabcontentIDs[ulid][tabcontentIDs[ulid].length]=relattribute}function saveselectedtabcontentid(ulid, selectedtabid){ //set id of clicked on tab as selected tab id & enter into cookieif (enabletabpersistence==1) //if persistence feature turned onsetCookie(ulid, selectedtabid)}function getullistlinkbyId(ulid, tabcontentid){ //returns a tab link based on the ID of the associated tab contentvar ullist=document.getElementById(ulid).getElementsByTagName("li")for (var i=0; i<ullist.length; i++){if (ullist[i].getElementsByTagName("a")[0].getAttribute("rel")==tabcontentid){return ullist[i].getElementsByTagName("a")[0]break}}}function initializetabcontent(){for (var i=0; i<arguments.length; i++){ //loop through passed UL idsif (enabletabpersistence==0 && getCookie(arguments[i])!="") //clean up cookie if persist=offsetCookie(arguments[i], "")var clickedontab=getCookie(arguments[i]) //retrieve ID of last clicked on tab from cookie, if anyvar ulobj=document.getElementById(arguments[i])var ulist=ulobj.getElementsByTagName("li") //array containing the LI elements within ULfor (var x=0; x<ulist.length; x++){ //loop through each LI elementvar ulistlink=ulist[x].getElementsByTagName("a")[0]if (ulistlink.getAttribute("rel")){savetabcontentids(arguments[i], ulistlink.getAttribute("rel")) //save id of each tab content as loop runsulistlink.onclick=function(){expandcontent(this)return false}if (ulist[x].className=="selected" && clickedontab=="") //if a tab is set to be selected by defaultexpandcontent(ulistlink) //auto load currenly selected tab content}} //end inner for loopif (clickedontab!=""){ //if a tab has been previously clicked on per the cookie valuevar culistlink=getullistlinkbyId(arguments[i], clickedontab)if (typeof culistlink!="undefined") //if match found between tabcontent id and rel attribute valueexpandcontent(culistlink) //auto load currenly selected tab contentelse //else if no match found between tabcontent id and rel attribute value (cookie mis-association)expandcontent(ulist[0].getElementsByTagName("a")[0]) //just auto load first tab instead}} //end outer for loop}function getCookie(Name){ var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pairif (document.cookie.match(re)) //if cookie foundreturn document.cookie.match(re)[0].split("=")[1] //return its valuereturn ""}function setCookie(name, value){document.cookie = name+"="+value //cookie value is domain wide (path=/)}
tabcontent.css

 

.shadetabs{padding: 3px 0;margin-left: 0;margin-top: 1px;margin-bottom: 0;font: bold 12px Verdana;list-style-type: none;text-align: left; /*set to left, center, or right to align the menu as desired*/}.shadetabs li{display: inline;margin: 0;}.shadetabs li a{text-decoration: none;padding: 3px 7px;margin-right: 3px;border: 1px solid #778;color: #2d2b2b;background: white url(shade.gif) top left repeat-x;}.shadetabs li a:visited{color: #2d2b2b;}.shadetabs li a:hover{text-decoration: underline;color: #2d2b2b;}.shadetabs li.selected{position: relative;top: 1px;}.shadetabs li.selected a{ /*selected main tab style */background-image: url(shadeactive.gif);border-bottom-color: white;}.shadetabs li.selected a:hover{ /*selected main tab style */text-decoration: none;}.tabcontentstyle{ /*style of tab content oontainer*/border: 1px solid gray;width: 450px;margin-bottom: 1em;padding: 10px;}.tabcontent{display:none;}@media print {.tabcontent {display:block!important;}}

Alguém manja ?

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.