Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1391933
    keith s
    Participant

    I cannot get the _blank target to work on this site. Below is a link of the site having this issue as well as a sample of the code.

    Agenda

    http://edgertonksdev.org/city-council/city-council-agendas-and-minutes/ *Once on the page drop the accordion 2017 Agendas and Minutes and click on a live link.

    http://edgertonksdev.org/resident-resources/public-safety-and-community-partners/ *This page has third party links to websites. Click to see the same issue.

    Thank you.

    #1391937
    keith s
    Participant
    This reply has been marked as private.
    #1392100
    Nabeel A
    Moderator

    Hi there,

    Thanks for writing in! It looks like target is not supported in accordion element. However you can do this with custom script, instead of target=”_blank” use class=”_blank” for example:

    <div class="x-column x-sm x-1-5"><a href="/wp-content/uploads/Council-Agenda-01-12-2017.pdf" class="_blank">Agenda</a></div>

    Do this for every item you need to open in new window, then add the following jQuery script in your Customizer via Appearance > Customize > Custom > Edit Global Javascript

    jQuery(document).ready(function($){
    	$('._blank').attr('target', '_blank');
    });

    Don’t forget to clear your browser’s cache after adding the code. Let us know how this goes!

    #1397930
    keith s
    Participant

    This worked awesome for the accordion targets. Now the target=_blank on menu items no longer works. What did I do wrong?

    Visit this page – http://edgertonksdev.org/city-council/ and select Public Hearing Notices in the left hand menu. It is set to open in a new window but will not. I think this was an issue prior to implementing the solution you suggested.

    Thank you for your assistance.

    #1398126
    Rupok
    Member

    Hi there,

    It supposed to work but as you are using within Widget, I guess that’s why it’s not working as expected. You can do the same as the suggestion. Like adding the custom class to the menu – http://prntscr.com/eh7hig

    In that case the JS code would be like :

    jQuery(document).ready(function($){
    	$('.open_blank a').attr('target', '_blank');
    });

    Cheers!

  • <script> jQuery(function($){ $("#no-reply-1391933 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>