Results 1 to 3 of 3

Thread: Side Push Menu v1.1 external txt file option not working

  1. #1
    Join Date
    Jun 2006
    Location
    Carmona, Seville, Spain.
    Posts
    66
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default Side Push Menu v1.1 external txt file option not working

    1) Script Title: Side Push Menu v1.1

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex1/pushmenu.htm

    3) Describe problem: I have script working properly when I put markup inside the page (inline) but I want the external file option as described in the instructions such as: mymenu.txt. I have made a .txt file with that name and placed it in the same folder as the other html pages. When I try it I get the error message from the js file.

    The contents of the mymenu.txt file are:

    <nav id="pushmenu1" class="pushmenu">
    <h2>La gramática inglesa: explicaciones y ejercicios...</h2>
    <ul class="mainnav">
    <h2>Navigation...!</h2>
    <p><a href="">Índice de cartas y emails bilingües ejemplos inglés español</a></p>
    <p> etc etc. </p>
    </ul>
    </nav>

    In the head of the html page I have:

    <script>
    jQuery(function(){ // on DOM Load
    var menu1 = pushmenu({
    menuid: 'pushmenu1',
    position: 'left',
    source: 'mymenu.txt'
    })
    })
    </script>

    As I say, if I just place the contents of mymenu.txt inline and take out: source: 'mymenu.txt', it all works (so js and css files working ok) but I want the external file option.

    Something silly I'm doing wrong. Can you help?

    Mike

  2. #2
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,859
    Thanks
    49
    Thanked 260 Times in 252 Posts
    Blog Entries
    56

    Default

    Try the following:
    1. Remove this code from the html-page:
    Code:
    <script>
    jQuery(function(){ // on DOM Load
    var menu1 = pushmenu({
    menuid: 'pushmenu1',
    position: 'left',
    source: 'mymenu.txt'
    })
    })
    </script>
    2. In the nav-section put:
    Code:
    <nav id="pushmenu1" class="pushmenu">
    <script>
    $('#pushmenu1').load('mymenu.txt')
    </script>
    </nav>
    That should do it.

  3. The Following User Says Thank You to molendijk For This Useful Post:

    green (11-23-2016)

  4. #3
    Join Date
    Jun 2006
    Location
    Carmona, Seville, Spain.
    Posts
    66
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    Thanks, Molendijk

    Actually, I got the previous code to work in the end but it didn't work in Chrome on my hard drive but only when loaded up to the web. Fortunately, with MF it works on my hard drive too. Thanks for helping out.

    Mike

Similar Threads

  1. Side Push Menu
    By Stevenj in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 06-14-2016, 03:10 AM
  2. More functionality to Side Push Menu
    By SpikeLee in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 01-17-2015, 07:01 PM
  3. Replies: 0
    Last Post: 08-18-2009, 05:12 PM

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
  •