Any help to make it work will be quite appeciated since fancybox in Umbraco makes my hair is grow greyer and greyer. Can it be becourse it is inside a .aspx file?
<a href='images/catboat.jpg' class='fancybox'><p>Her er noget tekst</p></a>
<a id='inline' class='fancybox' href="#data">This shows content of element who has id="data"</a>
<div style="display:none; width: 650px !important;"> <div id="data" style="width:600px !important"> <div style="width: 450px !important; padding-right: 15px !important; height: auto !important; float: left;">Lorem ipsum dolor sit amet, consectetur adipiscing elit.Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?</div> <div style="width: 100px !important; padding-right: 15px !important; height: auto !important; float: right;">Right-side</div> </div> </div> <script type='text/javascript'> $(document).ready(function() { $('.fancybox').fancybox(); }); </script>
Maybe the problem could be that the script is not being loaded. I can see you have the scripts files in the script folder in Umbraco. Have you tried to add an extra / in your your link to the css and scripts files to see if it will resolve your problem. I have marked the changes with bold
<a href='images/catboat.jpg' class='fancybox'><p>Her er noget tekst</p></a>
<a id='inline' class='fancybox' href="#data">This shows content of element who has id="data"</a>
<div style="display:none; width: 650px !important;"> <div id="data" style="width:600px !important">
<div style="width: 450px !important; padding-right: 15px !important;
height: auto !important; float: left;">Lorem ipsum dolor sit amet,
consectetur adipiscing elit.Quis autem vel eum iure reprehenderit qui in
ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui
dolorem eum fugiat quo voluptas nulla pariatur?</div>
<div style="width: 100px !important; padding-right: 15px !important;
height: auto !important; float: right;">Right-side</div> </div> </div> <script type='text/javascript'> $(document).ready(function() { $('.fancybox').fancybox(); }); </script>
Fancybox problems in Umbraco
Hi. The code below makes a fine Fancybox if I make a .html file and upload it to Umbraco.
When I put the same code inside Umbraco in a template or similar, it will not work.
- this works: https://premium.formuepleje.dk/fancybox_test.htm
- this does not work: https://premium.formuepleje.dk/fancybox/
Any help to make it work will be quite appeciated since fancybox in Umbraco makes my hair is grow greyer and greyer. Can it be becourse it is inside a .aspx file?
Thank you in advance
Lars
Here's the code:
<head>
<script type='text/javascript' src='http://code.jquery.com/jquery-latest.min.js'></script>
<link href="scripts/Fancybox/source/jquery/fancybox.css" rel="stylesheet" type="text/css" media="screen" />
<script type='text/javascript' src='scripts/Fancybox/source/jquery.fancybox.pack.js'></script>
<title>Fancybox</title>
</head>
<body>
<h1>Fancybox</h1>
<a href='images/catboat.jpg' class='fancybox'><p>Her er noget tekst</p></a>
<a id='inline' class='fancybox' href="#data">This shows content of element who has id="data"</a>
<div style="display:none; width: 650px !important;">
<div id="data" style="width:600px !important">
<div style="width: 450px !important; padding-right: 15px !important; height: auto !important; float: left;">Lorem ipsum dolor sit amet, consectetur adipiscing elit.Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?</div>
<div style="width: 100px !important; padding-right: 15px !important; height: auto !important; float: right;">Right-side</div>
</div>
</div>
<script type='text/javascript'>
$(document).ready(function() {
$('.fancybox').fancybox();
});
</script>
Hi Lars,
Maybe the problem could be that the script is not being loaded. I can see you have the scripts files in the script folder in Umbraco. Have you tried to add an extra / in your your link to the css and scripts files to see if it will resolve your problem. I have marked the changes with bold
I hope this can help you further
/Dennis
Hi Dennis
I solved the problem but I have absolutely no idéa about how I did it. But thank you very much for your answer and you are probally right.
//Lars
is working on a reply...