Calling a DIV from <a href and having a rewritable URL

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Franco Cassar
    New Member
    • Jan 2011
    • 13

    Calling a DIV from <a href and having a rewritable URL

    OK, so this is my problem.

    I'm trying to load an inline container using ibox. Basically it works fine, as long as when calling it, the URL is in the following structure: www.domain.com/likes.php (when clicked it produces www.domain.com/likes.php#inlin e_container

    However if the domain is in the structure www.domain.com/likes/24 due to rewritable URLs, this doesn't work anymore (when clicked it produces www.domain.com/likes/24#inline_conta iner

    This is my code:

    JS Import:
    Code:
    <script type="text/javascript" src="ibox/ibox.js"></script>
    Div:
    Code:
    <div id="inner_content" style="display:none;">
        <div style="background:#52425C;color:#ffffff;border:1px dashed #FFFFFF;padding:15px;margin:15px;">	
                    <p>Sample text</p>
        </div>
        </div>
    Link:
    Code:
    <li><a href="#inner_content" rel="ibox&width=600&height=410" title="Sample Title!">Create Your Post!</a></li>
    What do you think is the best solution to call the DIV and ignore the URL Rewriting structure?

    Thanks
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    You can avoid following the link by using return false onclick.

    If you need the hash to be added to the URL, consider the structure of your URL and find out what can work, e.g. www.domain.com/likes/24/#inner_content

    Comment

    Working...