0

I want to create an inline form with fancybox when I click in This shows content of element who has id='data', redirects me to the homepage :S

<title></title>

<script src="./fancybox/jquery.mousewheel-3.0.4.pack.js" type="text/javascript"></script>

<script src="./fancybox/jquery.fancybox-1.3.4.pack.js" type="text/javascript"></script>

<link media="screen" href="./fancybox/jquery.fancybox-1.3.4.css" type="text/css" rel="stylesheet"></link>
<script>
  $(document).ready(function() {

  $("#inline").fancybox({
   'titlePosition'  : 'inside',
   'transitionIn'  : 'none',
   'transitionOut'  : 'none'
  });
 });
</script>

------------

<div>
<a id="inline" href="#data">
         This shows content of element who has id='data'
    </a>
    <div style="display:none">
        <div id="data">
            Lorem ipsum dolor sit amet, consectetur adipiscing…

        </div>
    </div>
</div>
  • I assume you have a script like `$("#inline").fancybox()`, don't you? – JFK Dec 20 '14 at 05:10
  • same problem, look my edit. – Alan Martins De Azevedo Dec 22 '14 at 08:37
  • As far as I can tell your code works perfectly fine http://jsfiddle.net/x8b9m531/ Most likely you may need to review the paths to your fancybox css and js files. BTW, I don't see you are loading jQuery in your code above, didn't you forget it? Also, since you are using fancybox v1.3.4 you have to beware of 2 things: 1). That version doesn't work with jQuery v1.9+ see more http://stackoverflow.com/q/14344289/1055987 2). There is a bug with inline content. See [this](https://groups.google.com/forum/#!topic/fancybox/-re22BoXOzM) for a workaround. – JFK Dec 22 '14 at 18:19

0 Answers0