[Proto-Scripty] Do I stop observing events on element with Ajax.Autocompleter using Event.stopObserving()
Hi, I have a form with multiple text inputs (i.e. input type=text name=list_1 id=list_1 ... input type=text name=list_5 id=list_5) which all have Ajax.Autocompleter initialized. Now when I remove any of these autocompleting text inputs from the DOM, I want to stop observing events on these elements. However, Scriptaculous does not provide a way to unregister all the events that are handling the Ajax.Autocompleter for a particular element. I want to know if I should unregister all the events that are handling the Ajax.Autocompleter for a particular element by using Event.stopObserving() on that element or some other method? I don't want to resort to modifying Prototype or Scriptaculous and would prefer not to have to extend Ajax.Autocompleter class just for this task. 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-scriptacul...@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] How can I pause and resume PeriodicalExecuter?
Hi, does anybody know how I can pause and resume Prototype's PeriodicalExecuter? Basically, I have a simple example script that periodically executes every 1 second, but I want there to be a 5 second delay for each 5th time the script is executing. Here is the link to the example script I posted on Pastie: http://pastie.org/817286. -- 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-scriptacul...@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] Scriptaculous Effect.toggle on Prototype-extended elements
Hi, I am able to use Effect.fade on Prototype-extended elements. So, instead of doing the following: Effect.Fade('id_of_element'); I can do this instead: $('id_of_element').fade(); However, when I try to use Effect.toggle on Prototype-extended elements, it doesn't work. This works: Effect.toggle('id_of_element', 'appear'); But this doesn't work: $('id_of_element').toggle('appear'); Am I writing the code incorrectly (ie: $('id_of_element').toggle ('appear'); ) or is this just not possible and I should always write the code using Effect.toggle('id_of_element', 'appear'); ? Thank 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-scriptacul...@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] Help with blindup/blinddown effect using mouseover/mouseout events
Hi, I have a hidden block element absolutely positioned to the bottom right of my webpage. I am trying to display this block element when I mouseover that area and hide this block element when I mouseout from that area using Effects.BlindUp and Effects.BlindDown. At first glance, my webpage seems to work okay. However, if I repeatedly mouseover/mouseout of the area quickly, the block element becomes visible once I mouseout of that area even though the block element should be hidden. Can anybody tell me what is wrong with my code? Can anybody point me to a website or share some example code that would achieve the results that I am trying to pull? Thanks. I would have provided the sample code on pastie.org, but the site is down. Here is my sample code: !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; html xmlns=http://www.w3.org/1999/xhtml; head meta http-equiv=Content-Type content=text/html;charset=utf-8 / titleBlind Test/title script type=text/javascript src=http://ajax.googleapis.com/ajax/ libs/prototype/1.6.1.0/prototype.js/script script type=text/javascript src=http://ajax.googleapis.com/ajax/ libs/scriptaculous/1.8.3/scriptaculous.js/script script type=text/javascript document.observe(dom:loaded, function() { $('observearea').observe('mouseover', function() { if ($('peekaboo').visible()) { $('peekaboo').blindUp({ duration: 0.3, queue: { position: 'end', scope: 'modalbtnscope', limit: 1 } }); } else { $('peekaboo').blindDown({ duration: 0.3, queue: { position: 'end', scope: 'modalbtnscope', limit: 1 } }); } }); $('observearea').observe('mouseout', function() { if ($('peekaboo').visible()) { $('peekaboo').blindUp({ duration: 0.3, queue: { position: 'end', scope: 'modalbtnscope', limit: 1 } }); } else { $('peekaboo').blindDown({ duration: 0.3, queue: { position: 'end', scope: 'modalbtnscope', limit: 1 } }); } }); }); /script style type=text/css body {margin:0; padding:0;} #peekaboo { position:absolute; bottom:0px; right:10px; z-index:; width:100px; height:20px; background:pink; text-align:center; } #observearea { position:absolute; bottom:0px; right:10px; z-index:; width:100px; height:20px; } /style /head body div id=peekaboo style=display:none;divPeek-A-Boo/div/div div id=observearea/div /body /html -- 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-scriptacul...@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] How can I observe elements with class=test_1, test_2, test_3 or first_test, second_test, third_test?
Hi, I know how to observe elements with class=test. However, I would like to know how I would be able to observe elements with class=test_1, class=test_2 and class=test_3 or class=first_test, class=second_test and class=third_test. Here is my pastie url that observes elements with class=test and alerts the innerHTML of these elements: http://pastie.org/762352. Can someone please show me a code that will alert the innerHTML of elements that have classes test_1, test_2, test_3 and elements that have classes first_test, second_test, third_test? I am familiar w/ Javascript to know that this is possible but unfamiliar w/ Javascript to know how to achieve this. -- 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-scriptacul...@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] Why does document.viewport.getDimensions() not work without a DOCTYPE?
Hi, I have taken a look at the Prototype API and it says that document.viewport.getDimensions() should return the size of the viewport. I have created a simple page with a div with width of 100px and height of 100px. I am hoping to alert the height of the browser window, but I get the height of the div. I didn't understand why the height of the div got alerted instead of the browser window. It appears that I needed to add a DOCTYPE in order for document.viewport.getDimensions() to work properly. Can anybody explain why the DOCTYPE is required for Prototype to return the correct viewport height? I have pasted the code that incorrectly returns the height of the div instead of the viewport on pastie: http://pastie.org/504692. Just add a doctype and you get the correct result: Replace html with !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; html xmlns=http://www.w3.org/1999/xhtml; I hope to use Prototype with Ext JS in the future, but it seems that Prototype recommends/requires the use of DOCTYPES while Ext JS recommends against using DOCTYPES in order to avoid bugs in IE. - Paul K --~--~-~--~~~---~--~~ 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] Help! How to get document.body height using Element.getDimensions
Hi, I am unable to get the height of the body tag using Element.getDimensions although I can get the width of the body tag fine. How can I get the height of the body tag? I have my simple code pasted at http://pastie.org/468828. Here is the snippet of code below as well: function alertBodyDim() { /* $('main') refers to body id=main */ var dimensions = $('main').getDimensions(); alert(dimensions.width); alert(dimensions.height); } - Paul K --~--~-~--~~~---~--~~ 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('slide'), Effect.SlideUp, Effect.SlideDown is problematic in Opera
Hi, if you check the demo for Effect.toggle('slide'), Effect.SlideUp, Effect.SlideDown using the Opera browser, you will notice that you get Effect.toggle('blind'), Effect.BlindUp, Effect.BlindDown effect instead. http://github.com/madrobby/scriptaculous/wikis/effect-toggle http://github.com/madrobby/scriptaculous/wikis/effect-slidedown http://github.com/madrobby/scriptaculous/wikis/effect-slideup - Paul --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Effect.toggle slide doesn't work well with unordered/ordered list elements
Hi, I was inspired by http://www.exit404.com/2005/57/unobtrusive-persistant-scriptaculous-effects to create a menu that would expand and contract the menu whenever I click on the menu header. Instead of using Effect.BlindDown and Effect.BlindUp, I decided to use Effect.toggle to toggle the unordered list when I click on the menu header. I decided to use the slide effect for Effect.toggle, but found that it is buggy in FF3, IE7, Safari3 and works as it should in Opera9. It seems that adding Effect.toggle to ul is problematic. You can check out my result at http://icecreamcola.com/test/jsMenu.html or take a look at some code below: [html] div class=menu h3 id=menu-headRECENTLY/h3 ul id=menu-body liMenu List 1/li liMenu List 2/li liMenu List 3/li liMenu List 4/li liMenu List 5/li liMenu List 6/li liMenu List 7/li liMenu List 8/li /ul /div [/html] [script] function toggleMenu() { if ($('menu-head').getStyle('background-image').include('img/ sidebarh3bg.jpg') $('menu-head').getStyle('background- position')=='0px 0px') { Effect.toggle('menu-body', 'slide', {duration: 0.5}); Element.setStyle.delay(0.5, $('menu-head'), {background:'url(img/ sidebarh3bg.jpg) no-repeat -165px 0px', cursor:'pointer'}); } else { Effect.toggle('menu-body', 'slide', {duration: 0.5}); Element.setStyle.delay(0.5, $('menu-head'), {background:'url(img/ sidebarh3bg.jpg) no-repeat 0px 0px', cursor:'pointer'}); } } [/script] - Paul --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] $$() and Element.observe() question
Hi, I am having trouble with using Element.observe() with $$(). If I have an element with id=id, I can do this: $('id').observe('click', function() {alert('clicked');}); However, if I have elements with class=class, I can't do this: $$('.class').observe('click', function() {alert('clicked');}); I know that $$() returns a document-order array of extended DOM elements, but I have no idea how to use Element.observe() on the array returned by $$(). Any help will be greatly appreciated. - Paul --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---