Displaying 20 results from an estimated 36 matches for "addclassnam".
Did you mean:
addclassname
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
2006 Aug 07
5
RJS Change Background Color
What''s the page.method to change the background color of a DOM element? I''m
trying to change the background color of a couple of styled <li>''s when an
Ajax link is clicked.
Thanks,
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060807/63de04bf/attachment.html
2005 Sep 25
2
Preventing/allowing exceptions to occur in Element.add/remove ClassName
Hello everyone !
Thomas asked me to discuss 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) {...
2007 Oct 24
3
addClassName and removeClassName
...and sorry for the 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 rubyonrail...
2008 Mar 19
4
$("xxx") has no properties
hi!
I must miss something really essential that the following doesnt work:
I have a haml layout which includes the default javascripts, and the
application.js looks like this:
$("foobar").addClassName(''blue'');
the view looks like this:
<div id="foobar" class="green">testtest</div>
if I navigate to the site, I get the error "$("foobar") has no
properties".
I am using rails 2.0.2 and prototype 1.5.0
please help me I''...
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
eleme...
2007 Jun 09
4
Prototype Question
...ing to apply a css class to all LI elements that are children
of an element with the ID "idSelector".
This is what I did and it works. But I was wondering if there was an
easier way without having to use an anonymous function?
$$("#idSelector li").each(function()
{ arguments[0].addClassName("myClass") });
Thanks in advance.
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw...
2006 Jul 26
3
adding class or id tags to tags like linkto and form
I''m trying to figure out things like this by myself so I don''t bother my
developer and slow him down. How do I add class or id css attributes to
tags like this:
<%= form_remote_tag :url => { :action => "send_url" } %>
<%= link_to_remote "My Profile URL", :url => { :action =>
"send_profile_url", :id => @user.id } %>
2006 May 25
5
CSS Effects? (javascript?)
Is there a way to assign a CSS style to an element I am not currently
interacting with? For instance, if I have two TD elements of a table. I
click on one of them, and I want to have a style change in the other
element. Is this possible?
I''m guessing script.aculo.us might be able to help me.... but
considering how nothing on their site is loading for me right now I have
no way of
2005 Dec 20
0
swap css class
...s.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]);
}
}
}
});
________________________________...
2008 Apr 15
4
Best practice for showing ajax loader gif?
what is the best practice for showing animated ajax spinner?
The usual Element.show(''spinner'') has to stick with every form''s
:loading. Is there some easier or light-weight method?
Because I have this page that can contain upto 100 forms. And with all
of those would be 100 hidden spinners.
Please suggest something.
--
Posted via http://www.ruby-forum.com/.
2006 Dec 13
4
Effect.Opacity on Firefox Mac Dims text
...thumbnails that have a loading overlay placed over
them when they''re clicked on. The overlay is set to an opacity of .7..
.The onclick code looks basically does this:
var loading = document.createElement(''div'');
loading.id = ''loading_image'';
$(loading).addClassName(''thumb_loading'');
$(''container'').appendChild(loading);
Position.clone($(''myThumbnail'').parentNode,$(''loading_image''));
new Effect.Opacity($(''loading_image''),{duration: .2, to: .7});
As long as the loading im...
2006 Mar 31
2
RE: drag and drop sorting with an empty lis
...ate" 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;
border: 1px dashed #FFDD44;
background-color: #FFFF99;
}
The padding and style was enough to give a visibl...
2006 Jan 11
0
RE: Event.observer - unordered list problems
...is.mouseOverListener);
Event.observe(this, "mouseout",
this.mouseOverListener);
},
onMouseOver: function (event) {
var element = Event.findElement(event, ''LI'');
Element.addClassName(element, ''btn-hover'');
},
onMouseOut: function (event) {
var element = Event.findElement(event, ''LI'');
Element.removeClassName(element, ''btn-hover'');...
2006 Jan 11
0
RE: RE: Event.observer - unordered list problems
...is.mouseOverListener);
Event.observe(this, "mouseout",
this.mouseOverListener);
},
onMouseOver: function (event) {
var element = Event.findElement(event, ''LI'');
Element.addClassName(element, ''btn-hover'');
},
onMouseOut: function (event) {
var element = Event.findElement(event, ''LI'');
Element.removeClassName(element, ''btn-hover'');...
2006 May 30
0
problem with effect toggle - please help
...#39;'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-btn-expand'');
}
});
Marco M. Jaeger | Url: http://mmjaeger.com <http://mmjaeger.com/> | E-mail:
mail-yVS5avHIROZWk0Htik3J/w@public.gmane.org
Do you need business consulting,...
2007 Jun 09
1
Element extending problem
Okay, I posted about this a few days ago but couldn''t replicate it in my
test case.
I have this page, which everything works fine on... except some of the
prototype methods.
They do not appear to exist on an extended Element.
ie:
Element._extended = true
Element.up = undefined
Element.addClassName = function
Element.getElementsBySelector = undefined
I''ve been trying to figure this one out... I put an alert at the start of
Element.extend and loaded my page...
I only get one alert, and if I comment my $(''EditGrid'') line, it still comes
up.
It bails from the functi...
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
2006 Jan 23
6
Performance Issues with Autocompleter
...hich can be bottlenecks, I
would be glad
if you guys could comment about 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 rende...
2007 Nov 09
1
!important modifier in setStyle
Does anyone know a way to set the !important modifier when using
setStyle to change the css of an element?
It throws errors in IE but works fine in FF. Any insight is
appreciated.
--~--~---------~--~----~------------~-------~--~----~
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