search for: hasclassname

Displaying 15 results from an estimated 15 matches for "hasclassname".

2007 May 28
7
$$ is slooooow in IE
While $$ and getElementsByClassName are ridiculously speedy in Firefox (thanks to XPath), I''m finding both functions to be intolerably slow in IE. The page I''m working with has fewer than 1000 elements -- doesn''t seem THAT big -- and it''s still taking upwards of 4 seconds (!) to pick out the right ones. Are there documented problems with particular
2006 Jun 21
3
getElementsByClassName
How should I expect the performance of this function to be? I wrote this code: function CreateTOC(){ var $aTOC = document.getElementsByClassName(''tocitem''); if(isArray($aTOC)){ $temp = ''<INPUT TYPE="SUBMIT" NAME="cmdSave_Update" VALUE="Close" CLASS="menubuttons"> ''; $temp += ''<INPUT
2005 Sep 25
2
Preventing/allowing exceptions to occur in Element.add/remove ClassName
...scuss here the behavior of Element.addClassName, as relating to ticker #2232 [1]. In HEAD, if the element passed-in to Element.addClassName does not exist, an exception is thrown, and script execution stops there. I believe this is inconsistent with other functions: Object.extend(Element, { hasClassName: function(element, className) { element = $(element); if (!element) return; //... }, removeClassName: function(element, className) { element = $(element); if (!element) return; //... }, addClassName: function(element, className) { eleme...
2006 Nov 13
8
Problems with Prototype in script.aculo.us 1.6.5
Hi, When I''m using the Prototype version attached to script.aculo.us 1.6.5 (Prototype 1.5.0_rc1 revision [5462]) I get some "Object doesn''t support this property or method" in the Effect.BlindDown method (when the method tries to get the dimentions). If I''m using the version of prototype that was attached to 1.6.4 I do not get this error. Is this a known
2008 Apr 28
3
How to pass variable to $$()?
Hi all, I want the $$() method to take the selector as an variable. See below, I am trying to pass the class name as javascript variable so I can write a generic function in my application but $$() returns nothing for the following line var currentHightLightGroup ="amountsFields";//This one comes as a function parameter
2006 May 30
4
Limiting getElementsByClassName to specific nodes and entities
I''m currently using "The Ultimate getElementsByClassName" (http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/) instead of the Prototype version. This version seems to be faster since it lets you specify the starting node and the type of entity. For example: var widgets = getElementsByClassName(document, "ol", "tree"); Is
2006 Feb 27
11
Disabling anchor clicking in a draggable
Hey guys I have an interesting problem - I have some draggable elements (sortable actually), with links (<A>) inside them. I want the user to be able to click on the link, however if the user drags the element I don''t want the link to get fired. Can anyone think of a way to do this? It only needs to work in Firefox. Cheers -Rob
2005 Dec 20
0
swap css class
...i++) { tags = document.getElementsByTagName(args[i]); for (x = 0; x < tags.length; x++) { els[j] = tags[x]; j++; } } } // swap class name of elements for (i = 0; i < els.length; i++) { if (args[0] == 1) { // toggle class if (Element.hasClassName(els[i],args[3])) { Element.removeClassName(els[i],args[3]); Element.addClassName(els[i],args[2]); } else { Element.removeClassName(els[i],args[2]); Element.addClassName(els[i],args[3]); } } else { // don''t toggle Element.removeClassName(els[i],args[2]);...
2006 Sep 19
0
Effect.Highlight interferes with Effect.toggle
....handle = $(this.options.handle); } if(this.options.sibling){ this.options.sibling = $(this.options.sibling); } if(!this.options.parent && !this.options.handle){ this.options.sibling = element; } this.createButton(); if(this.options.visible || this.element.hasClassName(''active'')){ Element.show(this.element); if(!this.options.handle){ this.span.innerHTML = this.options.hideHTML; } }else{ Element.hide(this.element); if(!this.options.handle){ this.span.innerHTML = this.options.showHTML; }...
2006 Dec 26
1
One content at a time - Effect.toggle
Hi everyone, I am creating a web page which has many links to hidden <div> content, which on clicking reveals the <div> through "Effect.toggle Blind". When i click one link the corresponding <div> blinds down, but when i click some other link the first <div> still persists and won''t blind up. Can anyone please tell me how should i get to work such that
2007 Feb 17
4
childrenWithClassName
Hi, i need some help :) Does anywhere exists a fix for a code (scheme) like this: ---------------- var blas = document.getElementsByClassName( ''foo-class'', ''foo-id'' ); blas.each ( function( bla ) { var subbla = Element.childrenWithClassName( bla, ''subbla-class'', true ); } ); -------------- This scheme worked well till script.aculo
2008 Jan 24
10
sorting divs by class
I have a script that pulls in a bunch of data to my page and parses it out into the following format: <div id="container"> <div id="myID1" class="new">stuff</div> <div id="myID2" class="new">stuff</div> <div id="myID3" class="read">stuff</div> <div id="myID4"
2006 Feb 10
13
Element.observe () binding
Hey all, I working on a project, but I am not sure I can do what I want to do. The following works beautifully: Event.observe(el, ''click'', function () { this.className += " myClass"; return false; }); I have also tried doing this: this.varname = ''test''; Event.observe(el, ''click'', function () { alert (this.varname); }.bind
2009 Jul 07
0
[PATCH server] Update app to work with rails 2.3.2
...ement.collectTextNodesIgnoreClass = function(element, className) { +Element.collectTextNodesIgnoreClass = function(element, className) { return $A($(element).childNodes).collect( function(node) { return (node.nodeType==3 ? node.nodeValue : ((node.hasChildNodes() && !Element.hasClassName(node,className)) ? @@ -70,25 +70,20 @@ var Effect = { Transitions: { linear: Prototype.K, sinoidal: function(pos) { - return (-Math.cos(pos*Math.PI)/2) + 0.5; + return (-Math.cos(pos*Math.PI)/2) + .5; }, reverse: function(pos) { return 1-pos; }, fli...
2009 Jul 20
9
Upgrade server to run on Rails 2.3.2/F11
Note that one of the 8 patches (#6) will be sent separately in reply to this email, as some of the replaced lines are too long, so git won't let me send the email. However, there is nothing wrong with that patch, and it should be applied in the sequence listed below. Note also that I assume this will be tested on a clean f11 install, rather than an upgrade of an existing ovirt server