Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search

forrestbaer

Circle Member
  • Posts

    8
  • Joined

  • Last visited

  1. You can add a line that says : $(this).attr('onclick','true'); after the attr('href') line, that will fix it. So: <script src="http://code.jquery.com/jquery-latest.min.js"></script> <script> $(function() { $('.main-nav li a').each(function () { if ($(this).text() == 'Donate Now') { $(this).attr('href','http://www.paypal.com'); $(this).attr('onclick','true'); } }); }); </script> Make sure the 'Donate Now' is the exact same text as in the HTML, capitalization matters. Best,Forrest (cloudyreason.com)
  2. You can do this with a bit of JavaScript hackery. Here is some code to do it using jQuery, let’s say you had a folder called “Donate Now” that contained links to other ways to donate, but if you wanted the user to be able to click the folder directly you could add to your header code injection: <script src="http://code.jquery.com/jquery-latest.min.js"></script> <script> $(function() { $('.main-nav li a').each(function () { if ($(this).text() == 'Donate Now') { $(this).attr('href','http://www.paypal.com'); } }); }); </script> That would search through your main navigation links, find the one named “Donate Now”, and change the link from nothing to, PayPal in this example, put whatever you want there. Cheers,Forrest (cloudyreason.com)
×
×
  • Create New...