Simple Machine Codes
April 19, 2024, 07:54:18 pm
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome to SMC, the best place for your SMF For Free Codes
 
  Home Help Search Arcade Gallery Affiliates Code Index Staff List Calendar Members Login Register  

Add Text into User Area

Pages: [1]   Go Down
  Print  
Author Topic: Add Text into User Area  (Read 426 times)
0 Members and 1 Guest are viewing this topic.
Agent Moose
Administrator

Offline Offline

Gender: Male
Posts: 2,672



View Profile WWW
« on: July 10, 2007, 02:18:29 pm »

Requested By: vikhyat
Original Request: Click Here

Here is a tutorial on how to add text into the users area.  The users area is the part where it showes how long you stayed logged in for,

First, you will need to start out with the very beggning of each Javascript and Jquery code, the script tags:
Code:
<script>

</script>

Now, we are going to be useing Jquery, so now I am going to make the function name for it:
Code:
<script>
function text_in_userarea() {
$(function() {
//Created by Agent Moose at smcodes.smfforfree3.com

;});}
text_in_userarea()
</script>

Now that we have that part, you will need to find the exact place where you want to add the text to.

Code:
<script>
function text_in_userarea() {
$(function() {
//Created by Agent Moose at smcodes.smfforfree3.com
$("#upshrinkHeader td table tr td.windowbg2")
;});}
text_in_userarea()
</script>
The text is located in the id of #upshrinkHeader.  But, if you just add the #upshrinkHeader, it will show up any where uptop, so you need to go farther all the way to the accuall text of where you want to add your text under.  That is why I went all the way to the td.windowbg2 part.

Now that you have that done, all you have to do is add the text.  You can do that by useintg the .append() funciton for Jquery.
Code:
<script>
function text_in_userarea() {
$(function() {
//Created by Agent Moose at smcodes.smfforfree3.com
$("#upshrinkHeader td table tr td.windowbg2").append()
;});}
text_in_userarea()
</script>
The .append() funciton lets you add text to the ending of where you asked it to, and you asked it to add it to the ending of the td.windowbg2 part.

Code:
<script>
function text_in_userarea() {
//Created by Agent Moose at smcodes.smfforfree3.com
$(function() {
text = "YOUR TEXT HERE"
$("#upshrinkHeader td table tr td.windowbg2").append(text)
;});}
text_in_userarea()
</script>

Now, I have added a variable so that the variable text will go into the append() area.
Well, that is basicly the tutorial.  If you have any questions, please ask them in this thread.
Report Spam   Logged

Share on Facebook Share on Twitter



Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum

Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy