Pages: 12

  2007-09-24 17:15:21

shakiro214
» FTalkGeek
FTalk Level: zero
1188
0
1969-12-31

Want a different background layout to load everytime someone views your profile? :cool: Here's the code: [quote]//This is a shakiro214 production //In cooperation with friendsterTalk forum buffy =

Want a different background layout to load everytime someone views your profile? :cool: Here's the code: [quote]//This is a shakiro214 production //In cooperation with friendsterTalk forum buffy = new Array(); buffy[0]="[b]CSS_URL_1[/b]"; buffy[1]="[b]CSS_URL_2[/b]"; angel=Math.floor(Math.random() * buffy.length); try{ document.createStyleSheet(buffy[angel]); } catch(e){ var css = document.createElement("link"); css.type = "text/css"; css.rel = "stylesheet"; css.href=buffy[angel]; css.media = "screen, print"; document.getElementsByTagName("head")[0].appendChild(css); }[/quote] To add more layouts, simply add more arrays, like so [quote]buffy[2]="[b]CSS_URL_3[/b]"; buffy[3]="[b]CSS_URL_4[/b]"; buffy[4]="[b]CSS_URL_5[/b]";[/quote] and so on... If you want to use this for both IE and firefox and you are already using my 2 seperate CSS codes, simply change the name of the buffy array and the angel index when inserting the code for the second browser. :cool: Here's a full example of what a combined code would look like, if you use seperate CSS files for IE & FF: <">To see my [b]2 seperate CSS: 1 for IE & 1 for FF code[/b] click :arrow: [url=http://theftalk.com/t11644-seperate-files%3A.html]here[/url] [b]That's it. You're done![/b] :cool: :thumbsup: [b]credits: 091011[/b] - for her [b]"New Songs On Refresh Updated"[/b] topic which gave me the idea :cool: :thumbsup: [b]Feruzz[/b] - for the [i]document.write[/i] work-around

Last edited by shakiro214 (2008-03-09 12:46:51)

Pages: 12

Board footer

© 2025 F Talk

Current time is 22:06

[ 12 queries - 0.006 second ]
Privacy Policy