alessandro3
asked 9 years ago

Hi,
When I insert a photo in low resolution in a question, and I select "open media in new tab/window", the full size photo opens in the same window.
It seems the option is not working.
Thanks for your help!

5 Answers
DominicStaff
answered 9 years ago

Hi,
In the admin panel, go to Appearance > Editor, on the right hand side, look at Templates section. Open footer.php then paste this above

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript">
$('.dwqa-content a[href^="http://"]').attr('target','_blank');
</script>

If you still face there issue, you can send me username & password of your site for further checking.
Hope this helps !

alessandro3
answered 9 years ago

Dominic,
Thank you very much, it perfectly fixes the issue.
Have a good day!

alessandro3
answered 9 years ago

I spoke too soon!
The modification you suggested breaks the presentation page of Nirvana theme.
Sliders do not appear anymore!

dominic Staff
replied 9 years ago

You can send me username & password of your site (via private answer) for further checking.

DominicStaff
answered 9 years ago

Hi,
Please accept my apology for the delay in getting back to you.
I have helped you resolve this issue, you can check your site now.
To resolve this issue, I have added the following code to the dwqa-single-question.js file (plugins>dw-question-answer>inc>templates>default>assets>js). Line 9:

//Open linked media in new tab/window
jQuery(".dwqa-content a img").each(function (i) {
  // 'this' is the img element, you should get the parent anchor
  jQuery(this).parent().attr('target', '_blank'); 
});

Regards,

alessandro3
answered 9 years ago

Dominic,
It looks like the issue is perfectly fixed. I’ll mark the question as "resolved".

I thank you very very much and wish you a good week-end.

Best Regards,

Alessandro

Powered by DW Question & Answer Pro