Show Posts
|
Pages: [1] 2
|
1
|
Coding Community / Coding Snippets / Fade Locked Topics In Forum View
|
on: May 03, 2009, 11:10:25 am
|
What does it do: It will fade all locked topics in forum view. Preview: None Where does it go: Footers <script type="text/javascript"> /*Vitality - ZBCode*/ if(location.href.indexOf("board,")!=-1){ var getTd=document.getElementsByTagName("td") var gotTD=getTd.length; while(gotTD--){ if(getTd[gotTD].className=="windowbg"&&getTd[gotTD].innerHTML.indexOf("<span id=")!=-1&&getTd[gotTD].innerHTML.indexOf("<img")!=-1){ getTd[gotTD].parentNode.style.opacity='0.7'; } } } </script> You can edit that last line to change the opacity. Just change the 0.7 to whatever you want. The lower the number, the more you won't be able to see.
|
|
|
4
|
Coding Community / Coding Snippets / Quick Announcements
|
on: March 28, 2009, 12:53:32 pm
|
A quick announcement system where a new tab is added next to the "Members" tab, and when you hover over it, news will appear below the "Welcome to SMF For Free" text right above the tabs. When your mouse leaves the news area (the added news), it will collapse. Headers<script src="/jquery.js"></script> Footers<script type="text/javascript"> /*Vitality - TCZ|SMFforfree Support|Revolution X*/ var thenewnews="THIS IS THE NEWS!";
$("td.maintab_back:contains('Members')").after("<td id='thetab' class='maintab_back' style='cursor:pointer'>News</td>");$("td.titlebg2:contains('Welcome to SMF For Free')").append("<div id='thenews' style='display: none;'><br />"+thenewnews+"</div>");$("#thetab").mouseover(function(){$("#thenews").show();});$("#thenews").mouseout(function (){$("#thenews").hide();}); </script> Quickly edit the line var thenewnews="THIS IS THE NEWS!"; with the news you would like to have shown. Edit the part between the " ". Enjoy!
|
|
|
6
|
Coding Community / Coding Snippets / Scroll Up In Topics
|
on: November 27, 2008, 10:53:32 pm
|
A simple script that will place a link next to your report to a moderator link, and when it is clicked, it will scroll to the top of the page. I found scrolling back up to read previous posts on certain pages to be a bit tedious, so I wrote this up really quickly. <script> /*Vitality of TCZ || smfsupport || Revolution X*/ if(location.href.match('topic,')){ $("a:contains('Report to moderator')").after(" <a href='javascript:window.scrollTo(0,0);'>Go Up</a>"); } </script> Enjoy!
|
|
|
10
|
Coding Community / Coding Snippets / Toggle Category Headers
|
on: November 12, 2008, 09:25:00 pm
|
It does what the title says. If you click on the header of a category, it will collapse, and if you click it again, it will expand. I don't know how many browsers it will work in, I know it works in FF though. It's just something I whipped up very, very quickly. <script> /*Toggle Category Headers By Vitality of TCZ || Revolution X*/ $(".catbg").click(function (){$(this).next().toggle();}); </script>
|
|
|
11
|
Coding Community / Coding Snippets / Change Username Colors Across Board
|
on: November 11, 2008, 10:47:20 pm
|
If you're an admin, and your group color is red, this will find every link to your profile, and change the color of it to the color the group; in this case, it would be red. You can have multiple names colored, and in different colors. <script> /*Change username colors across board by Vitality of TCZ || Revolution X*/ var a = document.getElementsByTagName('a') function changer (xid,xuser,xcolor){ for(i=0,n=a.length;i<n;i++){ if(a[i].href.match(xid) && a[i].innerHTML.match(xuser)){ a[i].style.color=xcolor }}} changer("u=1","Vitality","blue"); </script> All you need to edit is that line at the bottom, right before the final script tag. Here is the outline if you're unsure of what goes where/if you'd like to add more (for reference): changer("u=#","USERNAME","COLOR"); Enjoy!
|
|
|
12
|
Coding Community / Coding Snippets / Re: Add Text To Copyright
|
on: November 10, 2008, 06:25:50 pm
|
Tested it in IE 7 on my test for, (Server 3) didn't work for me either. Trying to make it work though. But try this one, idk if it will work or not. <script> var CopyRight = "Testing, testing. 1, 2, 3.";
//Created by Agent Moose (smcodes.smfforfree3.com) $("#footerarea").append("<center><span class='smalltext'>" + CopyRight + "</span></center>"); </script> If you're going to add text or something of the like in jQuery, you should use append(). I altered the snippet in the quote.
|
|
|
|
|