By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,986 Members | 2,030 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,986 IT Pros & Developers. It's quick & easy.

Fancybox PDF integration

gautamz07
P: 26
This is the html code

Expand|Select|Wrap|Line Numbers
  1. <div class="col-md-4 col-md-offset-1" >
  2.               <h2>menu card</h2>
  3.               <a class="fancybox" href="menu.pdf" target="blank"><img src="images/menu-front-icon.png"></a>
  4.               <p></p>
  5.             </div>
  6.  
I have included the fancybox in the script tag .

Expand|Select|Wrap|Line Numbers
  1. <script src="fancybox/jquery.fancybox-1.3.4.min.js"></script>
  2.  
and here is the Jquery Code

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2.   $(document).ready(function() {
  3.   $('.fancybox').fancybox({
  4.  
  5.     openEffect  : 'none',
  6.     closeEffect : 'none',
  7.   });
  8. }); // end ready
  9. </script>
  10.  
Now let me explain what i am trying to do . First of all i am using the fancyBox plug-in , what it is suppose to do is stop the page from redirecting to a new page when the user clicks on the link which contains the pdf file .

but the page still redirects . why ? what am i not doing here ?

Thank you .

regards .

Gautam
May 30 '14 #1
Share this Question
Share on Google+
3 Replies


Dormilich
Expert Mod 5K+
P: 8,639
most people seem to use the iframe type for displaying PDFs in fancybox
May 30 '14 #2

gautamz07
P: 26
WOW ! you really saved my LIFE MAN ! Ur a Life saver , it worked in my demo project , now just Need to apply it to my real projects .

Thank you .

Gautam
May 30 '14 #3

Dormilich
Expert Mod 5K+
P: 8,639
actually, all I did was typing your question into google and cross-read some of the promising-looking results.
May 30 '14 #4

Post your reply

Sign in to post your reply or Sign up for a free account.