Displaying 20 results from an estimated 300 matches similar to: "addClassName and removeClassName"
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 class attribute matter?
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) {
element =
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()) {
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
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 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
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.
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:
2006 Jan 23
6
Performance Issues with Autocompleter
Hi All,
I am currently using script.aculo.us and Autocompleter for a project which I
am dealing now. I
faced a situation for which I couldnt find any solution and I could not see
any reference
regarding this issue in the enhancement/bug lists of script.aculo.us either.
Autocompleter component is working perfectly, if the information returned
from the server
does not exceed ~1000 LIs.
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 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
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,
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
2007 Apr 06
1
Authentication problems using libsmbclient API and DFS shares
Hi,
I'm trying to create a map of DFS links to actual
server/share's.? I know that you can get this information by logging
on to the DFS root server, but I'm trying to use the libsmbclient API to
get this information.
I have created a fairly simple DFS
structure on 2003 servers with everything on the same domain.
//MyDomain/DFSRoot
/Link1 -> //Fileserv-1/FileShare1
2006 Mar 07
6
[PATCH] Allow Ajax.InPlaceCollectionEditor to load collection externally
Attached is a patch to allow Ajax.InPlaceCollectionEditor to load the
collection using AJAX.
It adds a new option, loadOptionsURL, which is the URL used to load the
values over the interweb. It expects the server to return
<option></option> values. If one of them has a selected="selected"
attribute, it will probably be pre-selected. Not tested that though.
Also only tested
2007 Jun 09
4
Prototype Question
I''m trying 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.
2006 Apr 26
1
re-linking hard links
Hello,
I have a situation where I have numerous files with numerous hard links
to each of them on an ext3 RHEL4.2 system. Some of these files are
duplicates of the others. I would like to re-link all of the
duplicates to point to a single inode. For instance if file1 has
hardlinks link1 and link2, and file2 has hardlinks link3 and link4, I
need to change it so that link1, link2 (these
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 } %>
2008 Jan 09
4
Using Prototype - Getting Javascript Error - "Object doesn't support this property or method"
I have the following javascript being called on my site and I am
getting a Javascript error - "Object doesn''t support this property or
method". The error is invoked on the line that has - "listItems = $
("vidList").childElements("li");".
The purpose of the Javascript is two fold: ''swapVideo'' to change the
Youtube video and
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