Results 1 to 3 of 3

Thread: using rollover buttons with Dynamic Ajax Content

  1. #1
    Join Date
    Dec 2008
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Unhappy using rollover buttons with Dynamic Ajax Content

    1) Script Title: Dynamic Ajax Content

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...jaxcontent.htm

    3) Describe problem: sorry it's my first post on a forum, I'm a designer and I'm trying to set up my new site so it will load html pages into a div.

    I have read all the threads possible but do not really understand coding that well, so my apologies if i am going over stuff that's already been posted.

    nb: using dreamweaver to create my site.

    I have had a play with the files that accompany the ajax script and have been trying to get a rollover image to work with it by inserting it where the text links are in the code ( left hand column div) but the links don't work?

    the code that dreamweaver inserts is:

    Code:
    <a href="javascript:ajaxpage('ajaxfiles/external.htm', 'rightcolumn');"></a><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image1','','/images/buttons/about_over.gif',1)"><img src="/images/buttons/about_up.gif" name="Image1" width="53" height="28" border="0" id="Image1" /></a>
    however when I place a normal image the link works fine
    again code used by dreamweaver

    Code:
    <a href="javascript:ajaxpage('ajaxfiles/external.htm', 'rightcolumn');"><img src="/images/buttons/about_up.gif" /></a>
    if anyone could please help me to make this work with the roll over i would be very grateful.
    Last edited by jscheuer1; 12-08-2008 at 07:59 PM. Reason: format code

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    The first link in your two link combo has no trigger text or image to click on, and it would be better to use just one link. There are better ways to do rollovers, but if you like DW's MM system, or just want to use it because you are familiar with it, this should work:

    Code:
    <a href="javascript:ajaxpage('ajaxfiles/external.htm', 'rightcolumn');" 
    onmouseout="MM_swapImgRestore();" 
    onmouseover="MM_swapImage('Image1','','/images/buttons/about_over.gif',1);"
    ><img src="/images/buttons/about_up.gif" name="Image1" 
    width="53" height="28" border="0" id="Image1" alt=""></a>
    In an unrelated matter, using (as the demo page instructs) a javascript: href without an onclick event can be problematic, so it would be better to:

    Code:
    <a href="ajaxfiles/external.htm" 
    onclick="ajaxpage(this.href, 'rightcolumn'); return false;" 
    onmouseout="MM_swapImgRestore();" 
    onmouseover="MM_swapImage('Image1','','/images/buttons/about_over.gif',1);"
    ><img src="/images/buttons/about_up.gif" name="Image1" 
    width="53" height="28" border="0" id="Image1" alt=""></a>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Dec 2008
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Smile

    Thanks for your reply John, I will try this out.
    very much appreciated.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •