Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Bricolage: devel

javascript

 

 

Bricolage devel RSS feed   Index | Next | Previous | View Threaded


kjallad at dpsource

Jan 8, 2009, 1:57 PM

Post #1 of 2 (999 views)
Permalink
javascript

Howdy,

Internet Explorer does not seem to like the javascript
getAttribute('class') and setAttribute('class','xyz') methods. They work
but the document does not update dynamically - the sideNav menus were
not opening and closing on click making it tough for IE 7 users to do
stuff.



The attached patch fixed it for me - works in Firefox and IE7, but I
have not tested other browsers.



Regards, Kahil
Attachments: jspatch.txt (0.62 KB)


adeola at digitalcraftsmen

Jan 9, 2009, 8:55 AM

Post #2 of 2 (893 views)
Permalink
Re: javascript [In reply to]

On 8/1/09 21:57, Kahil Jallad wrote:
> - var newclass = parent.getAttribute('class') == 'open' ? 'closed' : 'open'
> - parent.setAttribute('class', newclass);
> + var newclass = parent.className == 'open' ? 'closed' : 'open'
> + parent.className = newclass;
With modern prototype this could be shortened to be:

/**
* Considering the current style it loads with
* is 'closed' this will just do the Right Thing
*/
parent.toggleClassName('open');

When I get enough tuits I'll have a look at way we can optimise and/or
refactor the javascript.

Adeola.

--
Creative Developer - Digital Craftsmen Ltd
Exmouth House, 3 Pine Street
London, EC1R 0JH
t: +44 20 7183 1410
f: +44 20 7099 5140
m: +44 75 9527 7886
w: http://www.digitalcraftsmen.net/

Bricolage devel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.