Displaying 20 results from an estimated 28 matches for "removeclassnam".
Did you mean:
removeclassname
2007 Oct 24
3
addClassName and removeClassName
...noob question!
I have an unordered list of 4 links where the links use Ajax.Updater
in the onclick:
onclick="new Ajax.Updater(''ajaxarea'', ''link1.php'', {asynchronous:true,
evalScripts:true }); return false;"
How would I go about using addClassName and removeClassName to show
the current link?
Thanks for any help with this.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group.
To post to this group, send email to rubyonrails-spinoffs-/JYPxA39U...
2005 Nov 09
1
Element.removeClassName(..) - bug or incorrect usage?
Hi,
I have just started using prototype.js and scriptaculous.js in one of
my projects. These libraries are awesome and they let me do so much
more, so easily.
At some point in my web interface, I have an element with multiple
classes, out of which one class needs to be removed.
I am using
Element.removeClassName(element, "classname to remove");
to achieve this.
This call does remove the specified class name. So far so good.
But after the call, instead of a space, the remaining classes are
separated by a "," and IE and FF do not apply these remaining classes.
The problem is better rep...
2005 Sep 25
2
Preventing/allowing exceptions to occur in Element.add/remove ClassName
...nt.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) {
element = $(element);
Element.removeClassName(element, className);
//...
},
}
As you can see, both hasClassName and remo...
2005 Dec 20
0
swap css class
...agName(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]);
Element.addClassName(els[i],args[3]);
}...
2006 Mar 31
2
RE: drag and drop sorting with an empty lis
I ran into this issue too. My solution was to add an "onUpdate" function to
the sortable that tests the container to see if it''s got any children or
not:
function is_empty(container)
{
if ($(container).hasChildNodes()) {
Element.removeClassName($(container),''empty'');
} else if (!$(container).hasChildNodes()) {
Element.addClassName($(container),''empty'');
}
}
I was using this for 2 sortable (UL) lists - my class for the "empty"
sortable just padded the container:
.empty {
padding: 10px;...
2007 Apr 20
4
prototype addClassName, toggleClassName
I have a question about prototype''s addClassName, removeClassName, and
toggleClassName. As expected, these functions add or remove a class
name from an element. When adding, the class names are appended to
the end of the class list of the element. Could this affect the
rendering of the element? Does the order of css class names in the
element''s cla...
2006 Jan 11
0
RE: Event.observer - unordered list problems
...''LI'');
Element.addClassName(element, ''btn-hover'');
},
onMouseOut: function (event) {
var element = Event.findElement(event, ''LI'');
Element.removeClassName(element, ''btn-hover'');
},
dispose: function() {
Event.stopObserving(this, "mouseover",
this.mouseOverListener);
Event. stopObserving (this, "mouseout",
this.mouseOverListener);...
2007 Jan 25
0
Testing RJS select method
Hi
How can I test this kind of RJS code?
page.select ''#id .class''.each do |element|
element.removeClassName(''whatever'')
end
I know that should_have_rjs admits a block, but i don''t know exactly
which is its purpose.
And I can test that the "select" part is beign called, but I don''t
know hot to test the "removeClassName" part.
Thanks in advance.
2006 Jan 11
0
RE: RE: Event.observer - unordered list problems
...''LI'');
Element.addClassName(element, ''btn-hover'');
},
onMouseOut: function (event) {
var element = Event.findElement(event, ''LI'');
Element.removeClassName(element, ''btn-hover'');
},
dispose: function() {
Event.stopObserving(this, "mouseover",
this.mouseOverListener);
Event. stopObserving (this, "mouseout",
this.mouseOverListener);...
2006 Jun 12
2
in_place_editor consumes html tags?
I''ve got a bog-standard view which displays textilized data. In the same
view, I have an in_place_editor which uses load_text_url to bring in
non-textilized data when editing.
Now, if I have html tags in the data loaded from load_text_url, they
appear to go missing. I can see the tags in the output from my
controller method using the console, but the tags are not shown in the
2006 May 30
0
problem with effect toggle - please help
...9;});
}
},
update: function() {
(Element.visible(this.bContentWrap)) ?
this.bBtnToggle.setAttribute(''title'', ''Collapse'') :
this.bBtnToggle.setAttribute(''title'', ''Expand'');
(Element.visible(this.bContentWrap)) ?
Element.removeClassName(this.bBtnToggle,''fm-btn-expand'') :
Element.removeClassName(this.bBtnToggle,''fm-btn-collapse'');
(Element.visible(this.bContentWrap)) ?
Element.addClassName(this.bBtnToggle,''fm-btn-collapse'') :
Element.addClassName(this.bBtnToggle, ''fm...
2006 Apr 18
4
update_page yields escaped code in callback
...ot;menu_tab" href="#" id="contacts_tab" onclick="new
Ajax.Updater(''section'', ''/contacts'', {asynchronous:true,
evalScripts:true, onComplete:function(request){try {
$$("menu_tab").each(function(value, index) {
value.removeClassName("current");
});
$("contacts_tab").add_class_name = "current";
$("section").hide();
$("section").visualEffect("Appear", "{queue:
''end''}");
} catch (e) { a...
2006 Jan 23
6
Performance Issues with Autocompleter
...it. (code snips are from control.js latest
released version)
<code snip>
render: function() {
if(this.entryCount > 0) {
for (var i = 0; i < this.entryCount; i++)
this.index==i ?
Element.addClassName(this.getEntry(i),"selected") :
Element.removeClassName(this.getEntry(i),"selected");
if(this.hasFocus) {
this.show();
this.active = true;
}
} else {
this.active = false;
this.hide();
}
}
</code snip>
The render function above is running into a for loop in order to
make the "High...
2008 Jun 30
1
javascript onclick for thumbnails
Hi,
i was struggling for a function where only 1 thumbnail should be active
and others inactive when clicked on the particular thumbnail.
code:
1. view:
2. <script type="javascript">
3. function PlayVideo_options(videoFile, id) {
4. document.getElementById(id).className = ''video_option
active_video'';
5. }
6. </script>
7.
8.
2006 Mar 02
0
[PATCH] small correction to allow editing of html with Ajax.InPlaceEditor
...from the loadTextURL Ajax callback. Bug or feature? I say bug.
The patch below fixes this.
-Rob
--- js/controls.js.old 2006-03-02 13:46:26.000000000 +0000
+++ js/controls.js 2006-03-02 13:46:29.000000000 +0000
@@ -628,7 +628,7 @@
onLoadedExternalText: function(transport) {
Element.removeClassName(this.form, this.options.loadingClassName);
this.editField.disabled = false;
- this.editField.value = transport.responseText.stripTags();
+ this.editField.value = transport.responseText;
},
onclickCancel: function() {
this.onComplete();
2006 Jan 18
0
Behaviour & Effect.Highlight?
...move style on mouseout). The styles contain a
border color and background color.
var myrules = {
''.sortable li'' : function(element){
element.onmouseover = function(){
Element.addClassName(element,''hover'');
},
element.onmouseout = function(){
Element.removeClassName(element,''hover'');
}
}
};
The problem occurs after I run "Effect.Highlight" on a list item - the
background color of the "hover" style is then ignored, but the border color
is applied.
I''ve tried adding "endcolor" and "restorecolor&...
2005 Oct 05
5
InPlaceEditor crash on Safari
Quick question..
I often crash my Safari when using ''Enter'' on InPlaceEditor''s for
submitting.
Works fine on firefox(win & Mac) - no javascript errors.
Anyone else seen this behavior?
(Maybe it is just my alterings of InPlaceEditor :-)
Best Regards
Michael Krog
2007 Nov 11
3
Scrollable selectbox for auto complete
Hi everyone,
I have used used scriptalicious for the autocomplete.
It works but with one problem.
When scrolling down the list, the values not visible are not scrolled
into focus.
eg I use the keyboard down or up key.
Here is my CSS
<style type="text/css">
div.auto_complete {
height: 100px;
width: 350px;
background:
2007 Jan 11
2
In-place editor for a whole form?
I want to implement in-place editing for a hierarchical structure where
the nodes are not simple text fields, but need to be represented by at
least two input elements.
The Rails helpers only support in-place editing for a text field,
scriptaculous''s controls.js beyond that implements support for an
in-place editor containing a select element. I need an editor where I
essentially
2006 Mar 17
1
Autocompleter.Local problem/desparate plea for help...
I have been trying to write a selector function for Autocompleter.Local that
will show a predefined Array and will scroll automatically to the first
match. I have had success with with getting my list to populate and show
all of the choices, however I cannot get it to scroll to the first match.
Since I build the JS Array I can know exactly how many items are in the list
going into my selector,