Jump to:

3439 Posts in 1028 Topics by 869 members

Template Questions

SilverStripe Forums » Template Questions » Fancybox with inline content not working

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 9349 Views
  • sashion
    Avatar
    Community Member
    23 Posts

    Fancybox with inline content not working Link to this post

    Hey guys,

    i´ve some trouble with the jQuery fancybox showing me some inline content.
    Pictures and iframes are no problem, but evertime I want to show some hidden text a fancybox opens with the complete content of the hole underlying html-site...
    Anyone an idea?

    This is the code snippet:

    <a class="various1" href="#inline" title="Lorem ipsum dolor sit amet">Inline</a>

    <div style="display: none;">
    <div id="inline" style="width:200px;height:200px;overflow:auto;">
       This content is supposed to be displayed in my fancybox
    </div>
    </div>

    Thx in advance.
    Sash

  • Invader_Zim
    Avatar
    Community Member
    141 Posts

    Re: Fancybox with inline content not working Link to this post

    Well i think it's a matter of the id's Fancybox uses.
    Here is a quick rewrite of your snippet, hope that works:

    <a id="inline" class="various1" href="#inlinedata" title="Lorem ipsum dolor sit amet">Inline</a>

    <div style="display: none;">
    <div id="inlinedata">
    This content is supposed to be displayed in my fancybox
    </div>
    </div>

    Cheers,
    Christian

  • sashion
    Avatar
    Community Member
    23 Posts

    Re: Fancybox with inline content not working Link to this post

    Hey Christian,

    thx for you answer. Unfortunately that didn´t solve the problem.

    I´ve found out that if I use jquery to replace the href after the silverstripe has loaded it works fine.

    Here the snippet:

    $("#various1").attr("href", "#inline");

    Probably Silverstripe adds the base_tag in front of all intern links so that fancybox doesn´t know what to do with it.
    Replacing href after silverstripe actions seems to work.

    Cheers,
    sash

    9349 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.