Results 1 to 2 of 2

Thread: omni slide menu interfering with other javascript stuff

  1. #1
    Join Date
    Jun 2008
    Posts
    192
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Default omni slide menu interfering with other javascript stuff

    1) Script Title:

    omni slide menu

    2) Script URL (on DD):

    http://www.dynamicdrive.com/dynamici...lide/index.htm

    3) Describe problem:

    This is kind of a complicated problem, but here goes...

    I have successfully programmed a couple omni slide menus into my website, but they seem to be interfering with something else. If you visit my website at http://www.shahspace.com/mm-theory, you'll see an asterix on the left-hand margin with "Click Me!" underneath it. If you click it, you get a message saying you don't have javascript enabled even though you do (otherwise, how would the omni slide menus work). This didn't use to happen. It use to create a small window with "Actually, for those well versed in the neurosciences..." written in it. For some reason, the omni slide menus are causing the asterix link to think javascript is disabled (or something like that). I know because when I remove the omni slide menus, it works properly again.

    That's the general problem description. Here's the technicalities:

    The code for the asterix link is like this:

    <a class="margin_icon" onclick="openWin('deeper_problem.htm','',600,1);return false;" href="enablejs.htm" target=_blank>
    <img class="margin_icon" src="icons/side.gif" alt="side.gif" border=0><br>
    <span class="margin_icon">
    Click Me!
    </span>
    </a>

    Here's the CSS for this:

    img.margin_icon {}
    a.margin_icon {
    text-decoration: none;
    }
    span.margin_icon {
    font-family: times new roman;
    font-size: 8pt;
    font-style: italic;
    }

    The openWin function is in its own text file that looks like this:

    function openWin(url,name,wid,hgt){
    sw=(screen.width-wid)/2;
    sh=(screen.height-hgt)/2;
    newwin=window.open(url,name,'width='+wid+',height='+hgt+',top='+sh+',left='+sw+',scrollbars=0,menubars=0,toolbars=0,directories=0,location=0,address=0');
    newwin.focus();
    }

    and I refer to it in the head section of my html page as follows:

    <script language="javascript" type="text/javascript" src="openwin.txt"></script>

    This line comes right before the header stuff for the omni slide menu.

    Can anyone see a reason why the browser might think javascript is disabled when it comes to clicking the margin icon, or why it follows the href to enablejs.htm rather than execute the openWin function specified in the onclick attribute of the a tag?

  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

    What is in (but commented out) your source code:

    Code:
    <!--<script language="javascript" type="text/javascript" src="openwin.js"></script>-->
    points to:

    Code:
    http://www.shahspace.com/mm-theory/openwin.js
    which is not on the server.

    If I remove the comments and change it to:

    Code:
    <script language="javascript" type="text/javascript" src="openwin.txt"></script>
    It works. The menu has nothing to do with it.
    - John
    ________________________

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

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
  •