Results 1 to 8 of 8

Thread: Remove URL's from headers

  1. #1
    Join Date
    May 2011
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Remove URL's from headers

    1) Script Title: Apple style Accordion Menu

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

    3) Describe problem: Hi,

    I have been searching through the posts but cannot find a solution to this issue.
    I am trying to remove the url link from each of the headers so that when you click on the header it does not redirect you. I am using the script as is - have tried removing the "clickgo" but has not helped.

    If I remove the url from the code then it removes the border round the header??

    Hope some help is out there,
    Thanks in advance
    Kev

  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

    So your headerclass is 'silverheader' then, right?

    If so, you can put this script on the page:

    Code:
    <script type="text/javascript">
    jQuery(function($){
    	$('.silverheader a').click(function(e){
    		e.preventDefault();
    	});
    });
    </script>
    That should do it!

    If not and/or you want more help:

    Please post a link to a page on your site that contains the problematic code so we can check it out.
    - John
    ________________________

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

  3. #3
    Join Date
    May 2011
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the quick response but unfortunately John that did not work - it just expanded all the sections out.

    Here is the link to the page:

    http://sascomputing.yolasite.com/education.php

  4. #4
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    I can't think of any reason that simply removing the URLs from the anchor tags shouldn't work. I tried it with no adverse affects - in what browser does it cause problems for you?

  5. #5
    Join Date
    May 2011
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I am using Google Chrome, just tried it in Firefox- same

    so if I remove "<a href="http://www.dynamicdrive.com/style/" >"

    from : </div>
    <div class="silverheader"><a href="http://www.dynamicdrive.com/style/" >Craigslist, Kijiji & eBay</a></div>
    <div class="submenu">

    then the header border and color disappear??

  6. #6
    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

    Quote Originally Posted by SAS View Post
    Thanks for the quick response but unfortunately John that did not work - it just expanded all the sections out.

    Here is the link to the page:

    http://sascomputing.yolasite.com/education.php
    Your current page has not followed the suggestion I outlined. Works here if I paste the command into the address bar. Are you sure you put the script on the page? If so, are you sure you weren't viewing a cached copy?

    Also what traq was saying could work. Instead of removing the a tag, try just removing the href attribute.
    - John
    ________________________

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

  7. #7
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    right - look at the source code in the link I posted. don't remove the anchor ( <a> ) tag, just remove the URL ( the href="" attribute (That's what I thought you meant in your first post.) ).

  8. #8
    Join Date
    May 2011
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Yes you are right, I did not know about leaving the anchor in. Works perfect now.

    Thanks for spelling it out for me, you guys are Elite!!

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
  •