Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
binding with prototype 1.6
Old 05-22-2009, 08:17 AM binding with prototype 1.6
Sleeping Troll's Avatar
Ultra Talker

Posts: 351
Name: Butch Begy
Trades: 0
#1
Today, 2:15 am
Sleeping Troll
Berserker
Join Date: Apr 2008
Posts: 174



binding with prototype
#1
Today, 2:15 am
Sleeping Troll
Berserker
Join Date: Apr 2008
Posts: 174



binding with prototype
I am new to prototype, thought it would be easiest way to accomplish cross browser compatibility... but alas, syntax escapes me in binding! Heeeeres... my code!
Code:
function OrbCreator(){
var b = new Element('img',{src: '../images/Orb.png', position: 'absolute', display: 'none', left: '10000px', top: '0px', width: '100px', height: '100px', zIndex: '0'});
$('container').insert(b);
this.set=setAttribute(b,);
}
 
function moveOrb(x,y,z){
left=x-Os;
top=y-Os;
zIndex=z;
height=Os;
width=Os;
opacity=1/z;
display='block';
this.set=display:display,left:left,top:top,width:width,height:height,zIndex:zIndex,opacity:opacity;
if(renew=2){
this.set({src:"../images/NewImage.png"});
}
if($('message').getStyle('top')>0){
writeAttribute("message",{top: top++})
}
}
So slap me silly and call me names, but what am I doing wrong and please, very importantly... why is it wrong and what is right, why?
__________________
Sleeping Troll, EMUSE, Mind Expansion...Truly serendipity!
Sleeping Troll is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-22-2009, 09:09 AM Re: binding with prototype 1.6
Sleeping Troll's Avatar
Ultra Talker

Posts: 351
Name: Butch Begy
Trades: 0
Having a little success with this code:
Code:
function OrbCreator(){
 var b = new Element('img',{src: '../images/Orb.png', position: 'absolute', display: 'none', left: '10000px', top: '0px', width: '100px', height: '100px', zIndex: '0'});
 $('container').insert(b);
 this.img=b;
 this.move=moveOrb;
}
 
function moveOrb(x,y,z){
 Left=x-Os;
 Top=y-Os;
 ZIndex=z;
 Height=Os;
 Width=Os;
 Opacity=1/z;
 Display='block';
 this.img.setAttribute(this.img,{display:Display,left:Left,top:Top,width:Width,height:Height,zIndex:ZIndex,opacity:Opacity});
 if(renew=2){
  this.img.setAttribute({src:"../images/NewImage.png"});
 }
 if($('message').getStyle('top')>0){
   writeAttribute("message",{top: top++})
 }
}
firebug error is "String contains an invalid character" code: "5
[Break on this error] this.img.setAttribute(this.img,{display...:Height, zIndex:ZIndex,opacity:Opacity});"
__________________
Sleeping Troll, EMUSE, Mind Expansion...Truly serendipity!
Sleeping Troll is offline
Reply With Quote
View Public Profile
 
Old 05-22-2009, 10:03 AM Re: binding with prototype 1.6
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
eliminate the properties one at a time to see which one it is.
__________________
Join me on
Please login or register to view this content. Registration is FREE
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 05-22-2009, 11:49 AM Re: binding with prototype 1.6
Sleeping Troll's Avatar
Ultra Talker

Posts: 351
Name: Butch Begy
Trades: 0
OK... it would seem that all or any throw the invalid char. error, so I'm guessing it is a syntax problem... are you proficient with prototype library? It seems powerful and time saving, however...
__________________
Sleeping Troll, EMUSE, Mind Expansion...Truly serendipity!

Last edited by Sleeping Troll; 05-22-2009 at 12:16 PM..
Sleeping Troll is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to binding with prototype 1.6
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.38721 seconds with 12 queries