Advertise Here

Author Topic: [Code] Elastic band  (Read 1301 times)

0 Members and 1 Guest are viewing this topic.

Offline JayB

  • SMF For Free Member
  • *
  • Posts: 60
  • Please do not PM for support
    • View Profile

  • Total Badges: 10
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 50 Posts
[Code] Elastic band
« on: June 23, 2009, 09:47:55 am »
Well im kinda going post crazy and posting all the codes i've created today but oh well the more the mairier well i've worked on this code for over three days now and just got it done so here it is.


Headers:

Code: [Select]
<STYLE>
v\:* {
 BEHAVIOR: url(#default#VML)
}
</STYLE>
 
<SCRIPT language="JavaScript1.2">
//By:JayB SMF SUPPORT
//Visit http://ThePogoHideout.mysmf.com
//Do not rip and take credit for this code as it took me over three days to make this



 var stringcolor="black" //EDIT black to whatever color that you want the elastic string to be
var ballsrc="IMAGES URL" //IMAGE URL=IMAGE YOU WANT ON THE END ON THE ELASTIC BAND SLING AROUND

///There is no need to edit anything else////////////////

if (document.all&&window.print){
document.write('<IMG id=Om style="LEFT: -12px; POSITION: absolute" src="'+ballsrc+'">')
ddx=0;ddy=0;PX=0;PY=0;xm=0;ym=0
OmW=Om.width/2;OmH=Om.height/2
}

     function Ouille(){
 x=Math.round(PX+=(ddx+=((xm-PX-ddx)*3)/100))
 y=Math.round(PY+=(ddy+=((ym-PY-ddy)*3-300)/100))
 Om.style.left=x-OmW
 Om.style.top=y-OmH
 elastoc.to=x+","+y
      //elastoc.strokecolor="RGB("+x+","+(2*y)+",0)"
 elastoc.strokecolor=stringcolor
     setTimeout("Ouille()",1)   
}
function momouse(){
 xm=window.event.x+5
 ym=window.event.y+document.body.scrollTop+15
     elastoc.from=xm+","+ym
}

  if(document.all&&window.print){
code="<v:line id=elastoc style='LEFT:0;POSITION:absolute;TOP:0' strokeweight='1.5pt'></v:line>"} else {
     code="<v:group style='LEFT:-11;WIDTH:100pt;POSITION:absolute;TOP:0;HEIGHT:100pt' coordsize='21600,21600'><v:line id=elastoc   style='LEFT:0;WIDTH:100pt;POSITION:absolute;TOP:0;HEIGHT:100pt' strokeweight='1.6pt'></v:line></v:group>"}

  if(document.all&&window.print){
document.body.insertAdjacentHTML("afterBegin",code)
document.onmousemove=momouse
Ouille()
}

</SCRIPT>

Here is a preview I can't explain it that well so...

http://JayBsTestSite.smfforfree.com

replace
Code: [Select]
var ballsrc="IMAGES URL" with the image you want on the end of the band
also if you want replace
Code: [Select]
var stringcolor="black" to what ever color you want the band to be.

Enjoy!
« Last Edit: June 23, 2009, 09:50:10 am by JayB »

Offline THE WIZARD

  • SMF For Free Member
  • *
  • Posts: 75
    • View Profile
    • Admin

  • Total Badges: 13
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: [Code] Elastic band
« Reply #1 on: September 20, 2009, 09:17:38 am »
good code, but can you that the string off it ??

 

Related Topics

  Subject / Started by Replies Last post
0 Replies
4352 Views
Last post June 04, 2008, 10:03:42 pm
by guest4485
0 Replies
789 Views
Last post July 07, 2008, 11:37:31 pm
by Tantalus
16 Replies
11025 Views
Last post January 18, 2009, 10:38:20 am
by Didds
6 Replies
1858 Views
Last post June 23, 2009, 06:23:46 am
by JayB
8 Replies
2342 Views
Last post August 02, 2009, 02:21:35 pm
by roser