Hi again,
Jonathan - I have tried that function in replace of my own and it
doesn't seem to work :-s Any ideas?
Thanks,
James
On Oct 23, 9:30 pm, ricardobeat [EMAIL PROTECTED] wrote:
A more resilient solution is to use class names instead, you can't
just drop/ignore the IDs altogether:
div
I've now got the divs sliding with this very simple code :
function divShowHide(divID, imgID){ // Hides/Shows the vehicle details
div and changes arrow appearance
var divToChange = document.getElementById(divID);
var arrowToChange = document.getElementById(imgID);
Using IDs with the solution I proposed above should work:
function divShowHide(divID, imgID){
var $divToShow = $('#'+divID);
var arrowURL = $divToShow.is(':visible') ? 'downarrow.gif'' :
'uparrow.gif'';
// the above is the same as: if ($divToShow.is(':visible')) { arrow
= 'downarrow.gif
Hi James,
Here's one way to rewrite it using jQuery:
function divShowHide(divID, imgID) {
var d = $('#' + divID).toggle();
$('#' + imageID).attr('src', 'Images/' + ( d.is(':visible') ?
'down' : 'up' ) + 'arrow.png' );
}
Cheers,
-Jonathan
On Oct 23, 2008, at 8:42 AM, James2008
A more resilient solution is to use class names instead, you can't
just drop/ignore the IDs altogether:
div class=titleProduct 8234/div (with background-image:
url(downarrow.gif) on CSS)
div class=descriptionbla bla bla bla/div
$('div.title').click(function(){
var arrow = (
5 matches
Mail list logo