[Proto-Scripty] problem extracting 'title' attribute
First I'll apologize for not knowing enough about javascript in general, let alone Prototype - I hope someone will take pity on me :p I'm building a page that displays quicktime movies when clicking on a horizontal scrolling thumbnail - okay, no problems with that. I'm using a code snippet I've found (and hacked) to embed the quicktimes, as follows: script function setMovie( url ) { $('movieHost').innerHTML = ''; var elEmbed = document.createElement( 'embed' ); elEmbed.src = url; elEmbed.setAttribute(width, 100%); elEmbed.setAttribute(height,100%); elEmbed.setAttribute(scale,aspect); elEmbed.setAttribute(bgcolor,black); $('movieHost').appendChild( elEmbed ); } new Ajax.Request( 'Quicktimes/movies.xml', { method: 'get', onSuccess: function( transport ) { var movieTags = transport.responseXML.getElementsByTagName ( 'movie' ); $('movieList').innerHTML = ''; var bFirst = true; for( var b = 0; b movieTags.length; b++ ) { var url = movieTags[b].getAttribute('xxx'); var title = movieTags[b].getAttribute('title'); if ( bFirst ) { setMovie( url ); bFirst = false; } var html = 'a href=javascript:void setMovie(\''+url+'\');'; html += title+'/abr/'; $('movieList').innerHTML += html; } } } ); /script But instead of extracting from the 'movies.xml' file I'm invoking setMovie via: a href=# class=thumbnail onClick=setMovie('Quicktimes/ mov1.mov') onmouseover=MM_effectAppearFade('thumb1', 0, 0, 100, false) onmouseout=MM_effectAppearFade('thumb1', 0, 100, 0, false)img src=thumbs/mov1.gif alt=//a (When the user clicks on a thumbnail). So I'm guessing that the xml file is no longer a factor. What I'm looking to do is extract the 'title' attribute from the current playing quicktime movie and display it in a div on the page But I'm not sure how to wrangle the js to do that... and not sure where (or how) to add the 'title' parameter. Any help with this would be much appreciated - thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] onUpdate doeasnt work on tree Sortables
hi, I'm currently working on a sortable tree menu and I've coded this: html head style type=text/css .openable { text-decoration: underline; } .nonopenable { text-decoration: none; } /style script type=text/javascript src=js/prototype-1.6.0.3.js / script script type=text/javascript src=js/scriptaculous.js /script script type=text/javascript var a = new Array(); function toggleIcon(el) { if (a[el] == undefined) { a[el] = true; } if (a[el] == true) { a[el] = false; el.update(-); } else if(a[el] == false) { a[el] = true; el.update(+); } } Event.observe(window, 'load', function() { // treemenu $$(#treemenuli).each(function(parentElement) { if(parentElement.childElements().length) { Event.observe(parentElement.childElements()[1], 'click', function() { parentElement.childElements()[2].toggle(); toggleIcon(parentElement.childElements()[0]); }); } }); Sortable.create('treemenu',{ tree: true, scroll: window, constraint: false, onUpdate: function() { alert(Sortable.serialize('treemenu'));} }); }); /script /head body ul id=treemenu li id=listitem1 ITEM 1 /li li id=listitem2 span class=icon+/spanspan class=openableITEM 2 /span ul id=skuska li id=listSubitem1 span class=nonopenable subITEM 1 / span/li li id=listSubitem2 span class=nonopenable subITEM 2 / span/li /ul /li li id=listitem3 ITEM 3 /li li id=listitem4 span class=icon+/spanspan class=openableITEM 4 /span ul li id=listSubitem3 span class=nonopenable subITEM 11 / span/li li id=listSubitem4 span class=nonopenable subITEM 22 / span/li /ul /li /ul a href=# onclick=alert(Sortable.serialize('treemenu')) serialize /a /body /html the problems are: 1) onUpdate is not working - it NEVER alert me after sorting 2) as you see on the 3 line from the bottom an anchor - after clicking on it it should alert me about the list of the items - but it does not. Simply, it shows me a blanc alert window... Could you tell me, if there's something wring with the framework, or with my code(I checked it several times and althought I'm really tired, I hope I didn't make any lame mistakes ;-))? Thanks in advance --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] using script.aculo.us and prototype for Fade Out.
I have a timer setup on the page, where I have a div tag that's playing a 20 second video. When it's done, the div tag fades out. That's the great part... it works locally... However, when it's put out to the rest of the network, the timer isn't quite right. Anyone know how to tweak the timer across multiple browsers on the network? (eventually, my site will go live and I need to have this working before the live date) Here's the code. script type=text/javascript src=js/prototype.js/script script type=text/javascript src=js/scriptaculous.js/ script script type=text/javascript !-- var browserName=navigator.appName; if (browserName==Microsoft Internet Explorer) { Event.observe(window, 'load', function() { var fade=setTimeout(fadeout(), 41500); var hide=setTimeout($('DIVNAME').hide(), 42500); }); function fadeout(){ new Effect.Opacity(DIVNAME, {duration:1.0, from:1.0, to:0.0}); } } else { Event.observe(window, 'load', function() { var fade=setTimeout(fadeout(), 40400); var hide=setTimeout($('DIVNAME').hide(), 41500); }); function fadeout(){ new Effect.Opacity(DIVNAME, {duration:1.0, from:1.0, to:0.0}); } } //-- /script Anyone know how to tweak the code so it's consistant across the board? I have a link, but because it's work related - I can only share that link privately. Discretion is the key. -mb --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] setOpacity issue
Not sure what I'm doing wrong here but here is my problem: I have a few images that I want to display with 50% opacity. I've given these images the class name of alpha. Example: img src=../images/snapshots/thumbs/gma_x158.gif alt=Greg Martin Auctions width=156 height=118 class=alpha / Then, after the body tag I have: script language=javascript type=text/javascript $$('img.alpha').setOpacity(0.5); /script This does not work for me. It dose work however work if I give the img element an ID but that of course is not valid CSS if I use more then one and I would rather not give each img their own ID. Any help would be greatly appreciated. Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: setOpacity issue
Hi, $$('img.alpha').setOpacity(0.5); $$ returns an array[1][2], and arrays don't have a setOpacity method. You want to call the setOpacity method on each element in the array, which you can do in a variety of ways thanks to Prototype's Enumerable [3] mix-in, which it mixes in with arrays. In this case, probably Enumerable#invoke[4]. [1] http://prototypejs.org/api/array [2] https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array [3] http://prototypejs.org/api/enumerable [4] http://prototypejs.org/api/enumerable/invoke HTH! -- T.J. Crowder tj / crowder software / com Independent Software Engineer, consulting services available On Jun 12, 12:28 am, Brown Freelance sc...@brownfreelance.com wrote: Not sure what I'm doing wrong here but here is my problem: I have a few images that I want to display with 50% opacity. I've given these images the class name of alpha. Example: img src=../images/snapshots/thumbs/gma_x158.gif alt=Greg Martin Auctions width=156 height=118 class=alpha / Then, after the body tag I have: script language=javascript type=text/javascript $$('img.alpha').setOpacity(0.5); /script This does not work for me. It dose work however work if I give the img element an ID but that of course is not valid CSS if I use more then one and I would rather not give each img their own ID. Any help would be greatly appreciated. Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Prototype still causes ie7 to hang ?
Hi, Actually, the next release does away with that script tag entirely. You can check it out yourself, 1.6.1 RC2 is on the download page[1]. [1] http://prototypejs.org/download HTH, -- T.J. Crowder tj / crowder software / com Independent Software Engineer, consulting services available On Jun 11, 5:34 pm, david david.brill...@gmail.com wrote: Hi Nadav, It seems that next release of prototype will modify this behaviour by specifying a src='blank.js' which should not be defined (Jdalton answer in the specified thread). I think you should make the change, but verify in the same condition that it works ! -- david On 9 juin, 22:35, Nadav Blum nadav.b...@gmail.com wrote: Hi there I suspect that prototype 1.6.03 causes ie7 to hang occasionally after loading page. Is it plausible? I understood from previous posts that the issue has been solved. (http://groups.google.com/group/prototype-scriptaculous/browse_thread/ thread/a1c745463251a95d/548baf3fcd66c6de?lnk=gstq=ie +hang#548baf3fcd66c6de) Or maybe not yet ? Should I replace (line 4124:) document.write(script id=__onDOMContentLoaded defer src=//:\/ script); with document.write(script id=__onDOMContentLoaded defer src='//:blank.js'\/script); ?? Thanks so much Nadav --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: setOpacity issue
.. which if you want a quick answer would be ... $$('img.alpha').each(function(element) { $(element).setOpacity(0.5); }); - Original Message - From: T.J. Crowder t...@crowdersoftware.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Friday, June 12, 2009 8:07 AM Subject: [Proto-Scripty] Re: setOpacity issue Hi, $$('img.alpha').setOpacity(0.5); $$ returns an array[1][2], and arrays don't have a setOpacity method. You want to call the setOpacity method on each element in the array, which you can do in a variety of ways thanks to Prototype's Enumerable [3] mix-in, which it mixes in with arrays. In this case, probably Enumerable#invoke[4]. [1] http://prototypejs.org/api/array [2] https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array [3] http://prototypejs.org/api/enumerable [4] http://prototypejs.org/api/enumerable/invoke HTH! -- T.J. Crowder tj / crowder software / com Independent Software Engineer, consulting services available On Jun 12, 12:28 am, Brown Freelance sc...@brownfreelance.com wrote: Not sure what I'm doing wrong here but here is my problem: I have a few images that I want to display with 50% opacity. I've given these images the class name of alpha. Example: img src=../images/snapshots/thumbs/gma_x158.gif alt=Greg Martin Auctions width=156 height=118 class=alpha / Then, after the body tag I have: script language=javascript type=text/javascript $$('img.alpha').setOpacity(0.5); /script This does not work for me. It dose work however work if I give the img element an ID but that of course is not valid CSS if I use more then one and I would rather not give each img their own ID. Any help would be greatly appreciated. Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: setOpacity issue
.. which if you want a quick answer would be ... If he wants to use Enumerable#each and a closure, yes. In this situation, again, I'd probably use Enumerable#invoke. -- T.J. On Jun 12, 8:11 am, Alex McAuley webmas...@thecarmarketplace.com wrote: .. which if you want a quick answer would be ... $$('img.alpha').each(function(element) { $(element).setOpacity(0.5); }); - Original Message - From: T.J. Crowder t...@crowdersoftware.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Friday, June 12, 2009 8:07 AM Subject: [Proto-Scripty] Re: setOpacity issue Hi, $$('img.alpha').setOpacity(0.5); $$ returns an array[1][2], and arrays don't have a setOpacity method. You want to call the setOpacity method on each element in the array, which you can do in a variety of ways thanks to Prototype's Enumerable [3] mix-in, which it mixes in with arrays. In this case, probably Enumerable#invoke[4]. [1]http://prototypejs.org/api/array [2]https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global... [3]http://prototypejs.org/api/enumerable [4]http://prototypejs.org/api/enumerable/invoke HTH! -- T.J. Crowder tj / crowder software / com Independent Software Engineer, consulting services available On Jun 12, 12:28 am, Brown Freelance sc...@brownfreelance.com wrote: Not sure what I'm doing wrong here but here is my problem: I have a few images that I want to display with 50% opacity. I've given these images the class name of alpha. Example: img src=../images/snapshots/thumbs/gma_x158.gif alt=Greg Martin Auctions width=156 height=118 class=alpha / Then, after the body tag I have: script language=javascript type=text/javascript $$('img.alpha').setOpacity(0.5); /script This does not work for me. It dose work however work if I give the img element an ID but that of course is not valid CSS if I use more then one and I would rather not give each img their own ID. Any help would be greatly appreciated. Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Getting checked checkbox values
On 11 jun, 22:58, Alex McAuley webmas...@thecarmarketplace.com wrote: not if you wanted all checkboxes and seperate based on checked / unchecked values to send what is now checked and what was checked ! That's why I pointed you in the direction of form observers. If you execute the code after the page is loaded, of course it will only return the checked elements at that moment. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Getting checked checkbox values
A bit OTT for what the user wants but each to thier own ;) - Original Message - From: Maarten maartenwie...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Friday, June 12, 2009 9:05 AM Subject: [Proto-Scripty] Re: Getting checked checkbox values On 11 jun, 22:58, Alex McAuley webmas...@thecarmarketplace.com wrote: not if you wanted all checkboxes and seperate based on checked / unchecked values to send what is now checked and what was checked ! That's why I pointed you in the direction of form observers. If you execute the code after the page is loaded, of course it will only return the checked elements at that moment. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Google Maps and CSS questions
I know this isn't really a prototype issue but I don't know of any other forums. I am trying to embed the google maps api onto a page and it is getting hidden by the css. For the life of me I can't fix it. I asked on a CSS forum and they suggested I make a function for the element. So the code looks like this but it still isn't working. Any suggestions? http://paste.windower.net/f1c327c55 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http:// www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd html head meta http-equiv=content-type content=text/html; charset=utf-8 / titleCSS frameset generator/title style type=text/css /*bgein of frames setting*/ html{ margin:0; padding:0; height:100%; overflow:hidden; _padding:110px 225px 5px 5px; } body{ margin:0; padding:0; height:100%; overflow:hidden; zoom:1; } .frame{ position:absolute; top:0; left:0; right:0; bottom:0; overflow:hidden; zoom:1; _right:0; _bottom:0; _width:100%; _height:100%; _position:relative; } .frame-bd{ zoom:1; } #main-header{ overflow:hidden; position:absolute; width:100%; height:100px; top:0; left:0; _zoom:1; _overflow:visible; _padding:0 230px 0 0; } #main-header .frame{ overflow:auto; _padding:0 0 0 230px; _zoom:1; } #main-header .frame .frame-bd{ zoom:1; _margin:0 0 0 -230px; } #main-footer{ overflow:hidden; position:absolute; width:100%; height:0px; bottom:0; left:0; z-index:10; _zoom:1; _overflow:visible; _padding:0 230px 0 0; } #main-footer .frame{ overflow:auto; _padding:0 0 0 230px; _zoom:1; } #main-footer .frame .frame-bd{ zoom:1; _margin:0 0 0 -230px; } #pri-main{ overflow:hidden; position:absolute; top:105px; left:225px; right:5px; bottom:5px; z-index:2; _top:105px; _bottom:auto; _height:100%; } #pri-main .frame{ overflow:auto; } #pri-sub{ overflow:hidden; position:absolute; height:0px; top:105px; left:225px; right:5px; z-index:1; _botom:0; _width:100%; } #pri-sub .frame{ overflow:auto; } #sec-main{ overflow:hidden; position:absolute; width:220px; top:105px; bottom:5px; left:0; z-index:4; _height:100%; _bottom:auto; _padding:0 0 5px 0; } #sec-main .frame{ overflow:auto; _padding:0 0 5px 0; } #trd-main{ overflow:hidden; position:absolute; width:0px; top:105px; right:0; bottom:5px; z-index:4; _height:100%; _bottom:auto; _padding:0 0 5px 0; } #trd-main .frame{ overflow:auto; _padding:0 0 5px 0; } /*My Customized Theme*/ body{ font-size:0.78em; font:normal 0.78em/150% verdana,monospace; background:buttonface url(metal-solid.gif); } .frame{ background:#fff url(frame-shadow.gif) 0 0 no-repeat; _background-attachment:fixed; } /*Free HedgerWow Style*/ li{ _vertical-align:top; } .mod{ } .mod .bd{ padding:12px; } a.valid{ font:0/0 Arial; text-indent:-5000px; display:block; width:88px; height:33px; margin:4px 0; background:#ccc url(http://www.w3.org/Icons/valid-xhtml10) no- repeat; } a.generate{ padding:12px; display:-moz-inline-box; display:inline-block; color:#222; background:buttonface; border:solid 1px buttonshadow; border-top-color:buttonhighlight; border-left-color:buttonhighlight; margin:4px 12px 4px 0; vertical-align:top; } a.generate:hover{ border:solid 1px buttonshadow; border-right-color:buttonhighlight; border-bottom-color:buttonhighlight; } h1,h2,h3,h4{ margin:0; color:#fff; font-size:small; padding:5px; font-weight:bold; letter-spacing:1px; background:#444 url(metal-solid-dark.gif); opacity:0.7; zoom:1; filter:alpha(opacity=70); } p{ margin:3px 0; color:#666; } /style meta name=viewport content=initial-scale=1.0, user-scalable=no / script type=text/javascript src=http://maps.google.com/maps/api/js? sensor=true/script script type=text/javascript window.onload = displayGoogle; function displayGoogle(){ var google_wrap = document.getElementById(map_canvas); google_wrap.style.overflow=default; /* or use any other values except HIDDEN */ } function initialize() { var latlng = new google.maps.LatLng(39.2398190, -86.5133859); var myOptions = { zoom: 13, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById (map_canvas), myOptions); } /script /head body onload=initialize() div id=doc !--main-header-- div id=main-header div class=frame div class=frame-bd !--My HTML-- div class=mod div class=hd h2Header/h2 /div
[Proto-Scripty] Re: onUpdate doeasnt work on tree Sortables
and also, I placed the whole source on http://agrotim.sk/maks/treemenu/# just for you :-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Effect.toggle('BLIND'); select by class not id
Hi is it possible to select a Element by it’s class? I want to blind 2 div with one click and id are unique. for Example: a href=# onclick=Effect.toggle('class2','BLIND'); return false;Toggle blind/a div id=d2 class=”class2” style=display:none;div ptext/p /div/div Thanks, regards John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: using script.aculo.us and prototype for Fade Out.
Well, the player is just a simple SWF with a streaming video (there are no controls) created in Flash using the video component, telling it where to find the video to play - I purposely left out the controls in an effort to just have a video intro play. My Flash development skills are horrible, to say the least - so I wouldn't know how to go about adding play buttons, ActionScript (to tell the browser when the video is done), etc... I just thought a timer with the Script.acul.ous/Prototype Fade Effect was a good way to go... If you can think of anything that would help me out, any input would be appreciated. Thanks for responding. -mb On Jun 12, 3:18 am, T.J. Crowder t...@crowdersoftware.com wrote: Hi, Frankly, I don't think you'll ever get that to work reliably barring receiving a notification from the player that the video has finished playing (which would require that you use a specific player, which isn't as desireable as just letting the user choose by sending the movie data). There are too many variables -- such as whether the user paused the video for a minute to take a phone call, etc. I wouldn't be surprised if some browsers fired the window load event when the video was ready to start playing rather than when it finishes copying (I know it waits for images, but perhaps some vendors treat movies and other long-running content differently), and so network delays in the middle that hold up the video would mess up your timing. Etc. Instead, FWIW, I'd recommend revising the UI approach. -- T.J. Crowder tj / crowder software / com Independent Software Engineer, consulting services available On Jun 11, 9:15 pm, mb2000inc mb2000...@gmail.com wrote: I have a timer setup on the page, where I have a div tag that's playing a 20 second video. When it's done, the div tag fades out. That's the great part... it works locally... However, when it's put out to the rest of the network, the timer isn't quite right. Anyone know how to tweak the timer across multiple browsers on the network? (eventually, my site will go live and I need to have this working before the live date) Here's the code. script type=text/javascript src=js/prototype.js/script script type=text/javascript src=js/scriptaculous.js/ script script type=text/javascript !-- var browserName=navigator.appName; if (browserName==Microsoft Internet Explorer) { Event.observe(window, 'load', function() { var fade=setTimeout(fadeout(), 41500); var hide=setTimeout($('DIVNAME').hide(), 42500); }); function fadeout(){ new Effect.Opacity(DIVNAME, {duration:1.0, from:1.0, to:0.0}); } } else { Event.observe(window, 'load', function() { var fade=setTimeout(fadeout(), 40400); var hide=setTimeout($('DIVNAME').hide(), 41500); }); function fadeout(){ new Effect.Opacity(DIVNAME, {duration:1.0, from:1.0, to:0.0}); } } //-- /script Anyone know how to tweak the code so it's consistant across the board? I have a link, but because it's work related - I can only share that link privately. Discretion is the key. -mb- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: using script.aculo.us and prototype for Fade Out.
Hi, Well, the player is just a simple SWF with a streaming video... Ah. I thought you were just sending the movie data and letting the user choose how they play it -- the preferred solution, in my book, since I'm big on individual choice. (I hate having 18 different viewers pushed at me.) I know less about Flash development than you do (don't get me started on Flash, I'm not a fan), but I know from having been forced to use it (as a user) on occasion that you can trigger an event via ActionScript that can be handled in JavaScript. I'd see what the folks in the Flash or ActionScript groups have to say, I bet it's not hard. Then you wouldn't have to worry about the timing. Good luck, -- T.J. Crowder tj / crowder software / com Independent Software Engineer, consulting services available On Jun 12, 2:02 pm, mb2000inc mb2000...@gmail.com wrote: Well, the player is just a simple SWF with a streaming video (there are no controls) created in Flash using the video component, telling it where to find the video to play - I purposely left out the controls in an effort to just have a video intro play. My Flash development skills are horrible, to say the least - so I wouldn't know how to go about adding play buttons, ActionScript (to tell the browser when the video is done), etc... I just thought a timer with the Script.acul.ous/Prototype Fade Effect was a good way to go... If you can think of anything that would help me out, any input would be appreciated. Thanks for responding. -mb On Jun 12, 3:18 am, T.J. Crowder t...@crowdersoftware.com wrote: Hi, Frankly, I don't think you'll ever get that to work reliably barring receiving a notification from the player that the video has finished playing (which would require that you use a specific player, which isn't as desireable as just letting the user choose by sending the movie data). There are too many variables -- such as whether the user paused the video for a minute to take a phone call, etc. I wouldn't be surprised if some browsers fired the window load event when the video was ready to start playing rather than when it finishes copying (I know it waits for images, but perhaps some vendors treat movies and other long-running content differently), and so network delays in the middle that hold up the video would mess up your timing. Etc. Instead, FWIW, I'd recommend revising the UI approach. -- T.J. Crowder tj / crowder software / com Independent Software Engineer, consulting services available On Jun 11, 9:15 pm, mb2000inc mb2000...@gmail.com wrote: I have a timer setup on the page, where I have a div tag that's playing a 20 second video. When it's done, the div tag fades out. That's the great part... it works locally... However, when it's put out to the rest of the network, the timer isn't quite right. Anyone know how to tweak the timer across multiple browsers on the network? (eventually, my site will go live and I need to have this working before the live date) Here's the code. script type=text/javascript src=js/prototype.js/script script type=text/javascript src=js/scriptaculous.js/ script script type=text/javascript !-- var browserName=navigator.appName; if (browserName==Microsoft Internet Explorer) { Event.observe(window, 'load', function() { var fade=setTimeout(fadeout(), 41500); var hide=setTimeout($('DIVNAME').hide(), 42500); }); function fadeout(){ new Effect.Opacity(DIVNAME, {duration:1.0, from:1.0, to:0.0}); } } else { Event.observe(window, 'load', function() { var fade=setTimeout(fadeout(), 40400); var hide=setTimeout($('DIVNAME').hide(), 41500); }); function fadeout(){ new Effect.Opacity(DIVNAME, {duration:1.0, from:1.0, to:0.0}); } } //-- /script Anyone know how to tweak the code so it's consistant across the board? I have a link, but because it's work related - I can only share that link privately. Discretion is the key. -mb- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Effect.toggle('BLIND'); select by class not id
Try this: a href=javascript:; id=toggleswitchToggle Blind/a Below goes in a script tag in the head document.observe('dom:loaded', function (){ $('toggleswitch').observe('click', function () { $$('.class2').each(function (d) { Effect.toggle(d, 'blind'); }); }); }); On Fri, Jun 12, 2009 at 7:47 AM, Gatsman jgats...@gmail.com wrote: Hi is it possible to select a Element by it’s class? I want to blind 2 div with one click and id are unique. for Example: a href=# onclick=Effect.toggle('class2','BLIND'); return false;Toggle blind/a div id=d2 class=”class2” style=display:none;div ptext/p /div/div Thanks, regards John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: setOpacity issue
I'm developing a library that will allow this sort of syntax. Actually, it allows you write jQuery syntax in Prototype, giving $() that power of $$() I've created a use case of your question. http://genevajs.com/demos/demo-set-opacity.php If you view source on the page, you'll see i'm calling prototype.js and genevajs (this is MY version, its filled with JUNK, please do not use this). GenevaJS allows me to write jQuery syntax in the Prototype environment. Compressed and g-zipped it comes it at 3k Rick On Fri, Jun 12, 2009 at 3:11 AM, Alex McAuley webmas...@thecarmarketplace.com wrote: .. which if you want a quick answer would be ... $$('img.alpha').each(function(element) { $(element).setOpacity(0.5); }); - Original Message - From: T.J. Crowder t...@crowdersoftware.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Friday, June 12, 2009 8:07 AM Subject: [Proto-Scripty] Re: setOpacity issue Hi, $$('img.alpha').setOpacity(0.5); $$ returns an array[1][2], and arrays don't have a setOpacity method. You want to call the setOpacity method on each element in the array, which you can do in a variety of ways thanks to Prototype's Enumerable [3] mix-in, which it mixes in with arrays. In this case, probably Enumerable#invoke[4]. [1] http://prototypejs.org/api/array [2] https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array [3] http://prototypejs.org/api/enumerable [4] http://prototypejs.org/api/enumerable/invoke HTH! -- T.J. Crowder tj / crowder software / com Independent Software Engineer, consulting services available On Jun 12, 12:28 am, Brown Freelance sc...@brownfreelance.com wrote: Not sure what I'm doing wrong here but here is my problem: I have a few images that I want to display with 50% opacity. I've given these images the class name of alpha. Example: img src=../images/snapshots/thumbs/gma_x158.gif alt=Greg Martin Auctions width=156 height=118 class=alpha / Then, after the body tag I have: script language=javascript type=text/javascript $$('img.alpha').setOpacity(0.5); /script This does not work for me. It dose work however work if I give the img element an ID but that of course is not valid CSS if I use more then one and I would rather not give each img their own ID. Any help would be greatly appreciated. Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Effect.toggle('BLIND'); select by class not id
Thanks Rick but I found an other way 2 minutes ago I added this under the head script type=text/javascript function blind1(){ Effect.toggle('id 1 here','BLIND'); return false; } function blind2(){ Effect.toggle('id 2 here','BLIND'); return false; } /script And loaded the functions onclick a href=# onclick=blind1(); blindgr2;Click Me/a Thanks again for your time --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: setOpacity issue
Hi Rick, Sounds cool for people making the move over, or more importantly trying to use/port jQuery plug-ins for use in Prototype. I think I'd suggest anyone writing *new* code use the native API unless they expect to ditch Prototype for jQuery. :-) But very cool for other purposes! -- T.J. :-) On Jun 12, 3:33 pm, Rick Waldron waldron.r...@gmail.com wrote: I'm developing a library that will allow this sort of syntax. Actually, it allows you write jQuery syntax in Prototype, giving $() that power of $$() I've created a use case of your question. http://genevajs.com/demos/demo-set-opacity.php If you view source on the page, you'll see i'm calling prototype.js and genevajs (this is MY version, its filled with JUNK, please do not use this). GenevaJS allows me to write jQuery syntax in the Prototype environment. Compressed and g-zipped it comes it at 3k Rick On Fri, Jun 12, 2009 at 3:11 AM, Alex McAuley webmas...@thecarmarketplace.com wrote: .. which if you want a quick answer would be ... $$('img.alpha').each(function(element) { $(element).setOpacity(0.5); }); - Original Message - From: T.J. Crowder t...@crowdersoftware.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Friday, June 12, 2009 8:07 AM Subject: [Proto-Scripty] Re: setOpacity issue Hi, $$('img.alpha').setOpacity(0.5); $$ returns an array[1][2], and arrays don't have a setOpacity method. You want to call the setOpacity method on each element in the array, which you can do in a variety of ways thanks to Prototype's Enumerable [3] mix-in, which it mixes in with arrays. In this case, probably Enumerable#invoke[4]. [1]http://prototypejs.org/api/array [2] https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global... [3]http://prototypejs.org/api/enumerable [4]http://prototypejs.org/api/enumerable/invoke HTH! -- T.J. Crowder tj / crowder software / com Independent Software Engineer, consulting services available On Jun 12, 12:28 am, Brown Freelance sc...@brownfreelance.com wrote: Not sure what I'm doing wrong here but here is my problem: I have a few images that I want to display with 50% opacity. I've given these images the class name of alpha. Example: img src=../images/snapshots/thumbs/gma_x158.gif alt=Greg Martin Auctions width=156 height=118 class=alpha / Then, after the body tag I have: script language=javascript type=text/javascript $$('img.alpha').setOpacity(0.5); /script This does not work for me. It dose work however work if I give the img element an ID but that of course is not valid CSS if I use more then one and I would rather not give each img their own ID. Any help would be greatly appreciated. Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: setOpacity issue
TJ, Al MacDonald of Processing.js used GenevaJS in a presentation last night... he wanted to use Box2D.js (a prototype extension) but he's not familiar with Prototype syntax... anyway its now posted on our site, with links to his presentation. I dont see it as a tool for people making the move... no movement at all. I see it as a tool to reduce the amount of code we're writing. Or perhaps for a jQuery developer that gets a job at a prototype shop... there are many scenarios. We're planning on meeting with the Boston Rails Group soon to discuss working with them to build it into Rails as a helper to prototype... as I mentioned it gzips to 3k. Also - GenevaJS is sideways compatible, for example: $('.classname').eq(1).highlight(); eq(1) - jquery method for showing the element at index 1 of $('.classname'), it will get highlight()'ed from effects.js (yeah... that example is super simple.. but i've been doing some zany stuff, which i intend to post) Anyway, that example: http://genevajs.com/demos/demo-box2d.php I've made us way off topic. sorry about that. anyone with questions can email me directly. Rick On Fri, Jun 12, 2009 at 11:08 AM, T.J. Crowder t...@crowdersoftware.comwrote: Hi Rick, Sounds cool for people making the move over, or more importantly trying to use/port jQuery plug-ins for use in Prototype. I think I'd suggest anyone writing *new* code use the native API unless they expect to ditch Prototype for jQuery. :-) But very cool for other purposes! -- T.J. :-) On Jun 12, 3:33 pm, Rick Waldron waldron.r...@gmail.com wrote: I'm developing a library that will allow this sort of syntax. Actually, it allows you write jQuery syntax in Prototype, giving $() that power of $$() I've created a use case of your question. http://genevajs.com/demos/demo-set-opacity.php If you view source on the page, you'll see i'm calling prototype.js and genevajs (this is MY version, its filled with JUNK, please do not use this). GenevaJS allows me to write jQuery syntax in the Prototype environment. Compressed and g-zipped it comes it at 3k Rick On Fri, Jun 12, 2009 at 3:11 AM, Alex McAuley webmas...@thecarmarketplace.com wrote: .. which if you want a quick answer would be ... $$('img.alpha').each(function(element) { $(element).setOpacity(0.5); }); - Original Message - From: T.J. Crowder t...@crowdersoftware.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Friday, June 12, 2009 8:07 AM Subject: [Proto-Scripty] Re: setOpacity issue Hi, $$('img.alpha').setOpacity(0.5); $$ returns an array[1][2], and arrays don't have a setOpacity method. You want to call the setOpacity method on each element in the array, which you can do in a variety of ways thanks to Prototype's Enumerable [3] mix-in, which it mixes in with arrays. In this case, probably Enumerable#invoke[4]. [1]http://prototypejs.org/api/array [2] https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global. .. [3]http://prototypejs.org/api/enumerable [4]http://prototypejs.org/api/enumerable/invoke HTH! -- T.J. Crowder tj / crowder software / com Independent Software Engineer, consulting services available On Jun 12, 12:28 am, Brown Freelance sc...@brownfreelance.com wrote: Not sure what I'm doing wrong here but here is my problem: I have a few images that I want to display with 50% opacity. I've given these images the class name of alpha. Example: img src=../images/snapshots/thumbs/gma_x158.gif alt=Greg Martin Auctions width=156 height=118 class=alpha / Then, after the body tag I have: script language=javascript type=text/javascript $$('img.alpha').setOpacity(0.5); /script This does not work for me. It dose work however work if I give the img element an ID but that of course is not valid CSS if I use more then one and I would rather not give each img their own ID. Any help would be greatly appreciated. Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: setOpacity issue
GenevaJS ? IS there any relation to my homwtown ? Or is that purely coincidental? Best, Tobie On Jun 12, 7:45 pm, Rick Waldron waldron.r...@gmail.com wrote: TJ, Al MacDonald of Processing.js used GenevaJS in a presentation last night... he wanted to use Box2D.js (a prototype extension) but he's not familiar with Prototype syntax... anyway its now posted on our site, with links to his presentation. I dont see it as a tool for people making the move... no movement at all. I see it as a tool to reduce the amount of code we're writing. Or perhaps for a jQuery developer that gets a job at a prototype shop... there are many scenarios. We're planning on meeting with the Boston Rails Group soon to discuss working with them to build it into Rails as a helper to prototype... as I mentioned it gzips to 3k. Also - GenevaJS is sideways compatible, for example: $('.classname').eq(1).highlight(); eq(1) - jquery method for showing the element at index 1 of $('.classname'), it will get highlight()'ed from effects.js (yeah... that example is super simple.. but i've been doing some zany stuff, which i intend to post) Anyway, that example:http://genevajs.com/demos/demo-box2d.php I've made us way off topic. sorry about that. anyone with questions can email me directly. Rick On Fri, Jun 12, 2009 at 11:08 AM, T.J. Crowder t...@crowdersoftware.comwrote: Hi Rick, Sounds cool for people making the move over, or more importantly trying to use/port jQuery plug-ins for use in Prototype. I think I'd suggest anyone writing *new* code use the native API unless they expect to ditch Prototype for jQuery. :-) But very cool for other purposes! -- T.J. :-) On Jun 12, 3:33 pm, Rick Waldron waldron.r...@gmail.com wrote: I'm developing a library that will allow this sort of syntax. Actually, it allows you write jQuery syntax in Prototype, giving $() that power of $$() I've created a use case of your question. http://genevajs.com/demos/demo-set-opacity.php If you view source on the page, you'll see i'm calling prototype.js and genevajs (this is MY version, its filled with JUNK, please do not use this). GenevaJS allows me to write jQuery syntax in the Prototype environment. Compressed and g-zipped it comes it at 3k Rick On Fri, Jun 12, 2009 at 3:11 AM, Alex McAuley webmas...@thecarmarketplace.com wrote: .. which if you want a quick answer would be ... $$('img.alpha').each(function(element) { $(element).setOpacity(0.5); }); - Original Message - From: T.J. Crowder t...@crowdersoftware.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Friday, June 12, 2009 8:07 AM Subject: [Proto-Scripty] Re: setOpacity issue Hi, $$('img.alpha').setOpacity(0.5); $$ returns an array[1][2], and arrays don't have a setOpacity method. You want to call the setOpacity method on each element in the array, which you can do in a variety of ways thanks to Prototype's Enumerable [3] mix-in, which it mixes in with arrays. In this case, probably Enumerable#invoke[4]. [1]http://prototypejs.org/api/array [2] https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global. .. [3]http://prototypejs.org/api/enumerable [4]http://prototypejs.org/api/enumerable/invoke HTH! -- T.J. Crowder tj / crowder software / com Independent Software Engineer, consulting services available On Jun 12, 12:28 am, Brown Freelance sc...@brownfreelance.com wrote: Not sure what I'm doing wrong here but here is my problem: I have a few images that I want to display with 50% opacity. I've given these images the class name of alpha. Example: img src=../images/snapshots/thumbs/gma_x158.gif alt=Greg Martin Auctions width=156 height=118 class=alpha / Then, after the body tag I have: script language=javascript type=text/javascript $$('img.alpha').setOpacity(0.5); /script This does not work for me. It dose work however work if I give the img element an ID but that of course is not valid CSS if I use more then one and I would rather not give each img their own ID. Any help would be greatly appreciated. Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: setOpacity issue
Geneva Switzerland? It was named after this city. The idea being its a convention between two super powers :) Rick On Fri, Jun 12, 2009 at 5:25 PM, Tobie Langel tobie.lan...@gmail.comwrote: GenevaJS ? IS there any relation to my homwtown ? Or is that purely coincidental? Best, Tobie On Jun 12, 7:45 pm, Rick Waldron waldron.r...@gmail.com wrote: TJ, Al MacDonald of Processing.js used GenevaJS in a presentation last night... he wanted to use Box2D.js (a prototype extension) but he's not familiar with Prototype syntax... anyway its now posted on our site, with links to his presentation. I dont see it as a tool for people making the move... no movement at all. I see it as a tool to reduce the amount of code we're writing. Or perhaps for a jQuery developer that gets a job at a prototype shop... there are many scenarios. We're planning on meeting with the Boston Rails Group soon to discuss working with them to build it into Rails as a helper to prototype... as I mentioned it gzips to 3k. Also - GenevaJS is sideways compatible, for example: $('.classname').eq(1).highlight(); eq(1) - jquery method for showing the element at index 1 of $('.classname'), it will get highlight()'ed from effects.js (yeah... that example is super simple.. but i've been doing some zany stuff, which i intend to post) Anyway, that example:http://genevajs.com/demos/demo-box2d.php I've made us way off topic. sorry about that. anyone with questions can email me directly. Rick On Fri, Jun 12, 2009 at 11:08 AM, T.J. Crowder t...@crowdersoftware.com wrote: Hi Rick, Sounds cool for people making the move over, or more importantly trying to use/port jQuery plug-ins for use in Prototype. I think I'd suggest anyone writing *new* code use the native API unless they expect to ditch Prototype for jQuery. :-) But very cool for other purposes! -- T.J. :-) On Jun 12, 3:33 pm, Rick Waldron waldron.r...@gmail.com wrote: I'm developing a library that will allow this sort of syntax. Actually, it allows you write jQuery syntax in Prototype, giving $() that power of $$() I've created a use case of your question. http://genevajs.com/demos/demo-set-opacity.php If you view source on the page, you'll see i'm calling prototype.js and genevajs (this is MY version, its filled with JUNK, please do not use this). GenevaJS allows me to write jQuery syntax in the Prototype environment. Compressed and g-zipped it comes it at 3k Rick On Fri, Jun 12, 2009 at 3:11 AM, Alex McAuley webmas...@thecarmarketplace.com wrote: .. which if you want a quick answer would be ... $$('img.alpha').each(function(element) { $(element).setOpacity(0.5); }); - Original Message - From: T.J. Crowder t...@crowdersoftware.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Friday, June 12, 2009 8:07 AM Subject: [Proto-Scripty] Re: setOpacity issue Hi, $$('img.alpha').setOpacity(0.5); $$ returns an array[1][2], and arrays don't have a setOpacity method. You want to call the setOpacity method on each element in the array, which you can do in a variety of ways thanks to Prototype's Enumerable [3] mix-in, which it mixes in with arrays. In this case, probably Enumerable#invoke[4]. [1]http://prototypejs.org/api/array [2] https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global. .. [3]http://prototypejs.org/api/enumerable [4]http://prototypejs.org/api/enumerable/invoke HTH! -- T.J. Crowder tj / crowder software / com Independent Software Engineer, consulting services available On Jun 12, 12:28 am, Brown Freelance sc...@brownfreelance.com wrote: Not sure what I'm doing wrong here but here is my problem: I have a few images that I want to display with 50% opacity. I've given these images the class name of alpha. Example: img src=../images/snapshots/thumbs/gma_x158.gif alt=Greg Martin Auctions width=156 height=118 class=alpha / Then, after the body tag I have: script language=javascript type=text/javascript $$('img.alpha').setOpacity(0.5); /script This does not work for me. It dose work however work if I give the img element an ID but that of course is not valid CSS if I use more then one and I would rather not give each img their own ID. Any help would be greatly appreciated. Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to
[Proto-Scripty] Re: Effect.toggle('BLIND'); select by class not id
The way i shared with you allows you to do this task without repeating without repeating the code. Yes... i did that on purpose. On Fri, Jun 12, 2009 at 10:49 AM, Gatsman jgats...@gmail.com wrote: Thanks Rick but I found an other way 2 minutes ago I added this under the head script type=text/javascript function blind1(){ Effect.toggle('id 1 here','BLIND'); return false; } function blind2(){ Effect.toggle('id 2 here','BLIND'); return false; } /script And loaded the functions onclick a href=# onclick=blind1(); blindgr2;Click Me/a Thanks again for your time --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: setOpacity issue
Haha! Awesome! (And sorry for the typos before). On Jun 13, 12:33 am, Rick Waldron waldron.r...@gmail.com wrote: Geneva Switzerland? It was named after this city. The idea being its a convention between two super powers :) Rick On Fri, Jun 12, 2009 at 5:25 PM, Tobie Langel tobie.lan...@gmail.comwrote: GenevaJS ? IS there any relation to my homwtown ? Or is that purely coincidental? Best, Tobie On Jun 12, 7:45 pm, Rick Waldron waldron.r...@gmail.com wrote: TJ, Al MacDonald of Processing.js used GenevaJS in a presentation last night... he wanted to use Box2D.js (a prototype extension) but he's not familiar with Prototype syntax... anyway its now posted on our site, with links to his presentation. I dont see it as a tool for people making the move... no movement at all. I see it as a tool to reduce the amount of code we're writing. Or perhaps for a jQuery developer that gets a job at a prototype shop... there are many scenarios. We're planning on meeting with the Boston Rails Group soon to discuss working with them to build it into Rails as a helper to prototype... as I mentioned it gzips to 3k. Also - GenevaJS is sideways compatible, for example: $('.classname').eq(1).highlight(); eq(1) - jquery method for showing the element at index 1 of $('.classname'), it will get highlight()'ed from effects.js (yeah... that example is super simple.. but i've been doing some zany stuff, which i intend to post) Anyway, that example:http://genevajs.com/demos/demo-box2d.php I've made us way off topic. sorry about that. anyone with questions can email me directly. Rick On Fri, Jun 12, 2009 at 11:08 AM, T.J. Crowder t...@crowdersoftware.com wrote: Hi Rick, Sounds cool for people making the move over, or more importantly trying to use/port jQuery plug-ins for use in Prototype. I think I'd suggest anyone writing *new* code use the native API unless they expect to ditch Prototype for jQuery. :-) But very cool for other purposes! -- T.J. :-) On Jun 12, 3:33 pm, Rick Waldron waldron.r...@gmail.com wrote: I'm developing a library that will allow this sort of syntax. Actually, it allows you write jQuery syntax in Prototype, giving $() that power of $$() I've created a use case of your question. http://genevajs.com/demos/demo-set-opacity.php If you view source on the page, you'll see i'm calling prototype.js and genevajs (this is MY version, its filled with JUNK, please do not use this). GenevaJS allows me to write jQuery syntax in the Prototype environment. Compressed and g-zipped it comes it at 3k Rick On Fri, Jun 12, 2009 at 3:11 AM, Alex McAuley webmas...@thecarmarketplace.com wrote: .. which if you want a quick answer would be ... $$('img.alpha').each(function(element) { $(element).setOpacity(0.5); }); - Original Message - From: T.J. Crowder t...@crowdersoftware.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Friday, June 12, 2009 8:07 AM Subject: [Proto-Scripty] Re: setOpacity issue Hi, $$('img.alpha').setOpacity(0.5); $$ returns an array[1][2], and arrays don't have a setOpacity method. You want to call the setOpacity method on each element in the array, which you can do in a variety of ways thanks to Prototype's Enumerable [3] mix-in, which it mixes in with arrays. In this case, probably Enumerable#invoke[4]. [1]http://prototypejs.org/api/array [2] https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global. .. [3]http://prototypejs.org/api/enumerable [4]http://prototypejs.org/api/enumerable/invoke HTH! -- T.J. Crowder tj / crowder software / com Independent Software Engineer, consulting services available On Jun 12, 12:28 am, Brown Freelance sc...@brownfreelance.com wrote: Not sure what I'm doing wrong here but here is my problem: I have a few images that I want to display with 50% opacity. I've given these images the class name of alpha. Example: img src=../images/snapshots/thumbs/gma_x158.gif alt=Greg Martin Auctions width=156 height=118 class=alpha / Then, after the body tag I have: script language=javascript type=text/javascript $$('img.alpha').setOpacity(0.5); /script This does not work for me. It dose work however work if I give the img element an ID but that of course is not valid CSS if I use more then one and I would rather not give each img their own ID. Any help would be greatly appreciated. Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the
[Proto-Scripty] Re: setOpacity issue
Thank you all very much for your help! Makes more since to me now. I'm still a little new to prototype.js On Jun 12, 5:15 pm, Tobie Langel tobie.lan...@gmail.com wrote: Haha! Awesome! (And sorry for the typos before). On Jun 13, 12:33 am, Rick Waldron waldron.r...@gmail.com wrote: Geneva Switzerland? It was named after this city. The idea being its a convention between two super powers :) Rick On Fri, Jun 12, 2009 at 5:25 PM, Tobie Langel tobie.lan...@gmail.comwrote: GenevaJS ? IS there any relation to my homwtown ? Or is that purely coincidental? Best, Tobie On Jun 12, 7:45 pm, Rick Waldron waldron.r...@gmail.com wrote: TJ, Al MacDonald of Processing.js used GenevaJS in a presentation last night... he wanted to use Box2D.js (a prototype extension) but he's not familiar with Prototype syntax... anyway its now posted on our site, with links to his presentation. I dont see it as a tool for people making the move... no movement at all. I see it as a tool to reduce the amount of code we're writing. Or perhaps for a jQuery developer that gets a job at a prototype shop... there are many scenarios. We're planning on meeting with the Boston Rails Group soon to discuss working with them to build it into Rails as a helper to prototype... as I mentioned it gzips to 3k. Also - GenevaJS is sideways compatible, for example: $('.classname').eq(1).highlight(); eq(1) - jquery method for showing the element at index 1 of $('.classname'), it will get highlight()'ed from effects.js (yeah... that example is super simple.. but i've been doing some zany stuff, which i intend to post) Anyway, that example:http://genevajs.com/demos/demo-box2d.php I've made us way off topic. sorry about that. anyone with questions can email me directly. Rick On Fri, Jun 12, 2009 at 11:08 AM, T.J. Crowder t...@crowdersoftware.com wrote: Hi Rick, Sounds cool for people making the move over, or more importantly trying to use/port jQuery plug-ins for use in Prototype. I think I'd suggest anyone writing *new* code use the native API unless they expect to ditch Prototype for jQuery. :-) But very cool for other purposes! -- T.J. :-) On Jun 12, 3:33 pm, Rick Waldron waldron.r...@gmail.com wrote: I'm developing a library that will allow this sort of syntax. Actually, it allows you write jQuery syntax in Prototype, giving $() that power of $$() I've created a use case of your question. http://genevajs.com/demos/demo-set-opacity.php If you view source on the page, you'll see i'm calling prototype.js and genevajs (this is MY version, its filled with JUNK, please do not use this). GenevaJS allows me to write jQuery syntax in the Prototype environment. Compressed and g-zipped it comes it at 3k Rick On Fri, Jun 12, 2009 at 3:11 AM, Alex McAuley webmas...@thecarmarketplace.com wrote: .. which if you want a quick answer would be ... $$('img.alpha').each(function(element) { $(element).setOpacity(0.5); }); - Original Message - From: T.J. Crowder t...@crowdersoftware.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Friday, June 12, 2009 8:07 AM Subject: [Proto-Scripty] Re: setOpacity issue Hi, $$('img.alpha').setOpacity(0.5); $$ returns an array[1][2], and arrays don't have a setOpacity method. You want to call the setOpacity method on each element in the array, which you can do in a variety of ways thanks to Prototype's Enumerable [3] mix-in, which it mixes in with arrays. In this case, probably Enumerable#invoke[4]. [1]http://prototypejs.org/api/array [2] https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global. .. [3]http://prototypejs.org/api/enumerable [4]http://prototypejs.org/api/enumerable/invoke HTH! -- T.J. Crowder tj / crowder software / com Independent Software Engineer, consulting services available On Jun 12, 12:28 am, Brown Freelance sc...@brownfreelance.com wrote: Not sure what I'm doing wrong here but here is my problem: I have a few images that I want to display with 50% opacity. I've given these images the class name of alpha. Example: img src=../images/snapshots/thumbs/gma_x158.gif alt=Greg Martin Auctions width=156 height=118 class=alpha / Then, after the body tag I have: script language=javascript type=text/javascript $$('img.alpha').setOpacity(0.5); /script This does not work for me. It dose work however work if I give the img