Jump to content

PHP and leanmodal (jquery)


caracarogna

Recommended Posts

I'm using php but to open modal popup I'm using leanModal (jquery).

More or less the code to open the modal window is the follow:

<head>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
    <script type="text/javascript" src="./Js/jquery.leanModal.min.js"></script>
    <script>
        $(function()
            {
                $('a[rel*=leanModal]').leanModal({ top : 200, closeButton: ".modal_close" });                 
            });
    </script>  

    <style>
        #lean_overlay
        {
            position: fixed;
            z-index:100;
            top: 0px;
            left: 0px;
            height:100%;
            width:100%;
            background: #000;
            display: none;
        }
    </style>

</head>

<body> 
<a id='go' href='#register' name='registrazione' rel='leanModal'>Registrazione</a>

<?php
echo "<div id='register' class='moddiv' style='display: none; '> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec libero. Suspendisse bibendum. Cras id urna. Morbi tincidunt, orci ac convallis aliquam, lectus turpis varius lorem, eu posuere nunc justo tempus leo. Donec mattis, purus nec placerat bibendum, dui pede condimentum odio, ac blandit ante orci ut diam. Cras fringilla magna. Phasellus suscipit, leo a 	</div>";
?>

</body> 

It's work fine but I need to insert in the popup some more info...

I'd like to pass via querystring a value in order to use it in my modal window ...

I've try with the following modification:

 

<a id='go' href='?Value=123456#register' name='registrazione' rel='leanModal'>Registrazione</a>

<?php
echo "<div id='register' class='moddiv' style='display: none; '> $_POST['Value']   Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec libero. Suspendisse bibendum. Cras id urna. Morbi tincidunt, orci ac convallis aliquam, lectus turpis varius lorem, eu posuere nunc justo tempus leo. Donec mattis, purus nec placerat bibendum, dui pede condimentum odio, ac blandit ante orci ut diam. Cras fringilla magna. Phasellus suscipit, leo a     </div>";
?>

But it's not working, adding "?Value=123456" the leanmodal fail ...

The question is: It is possible pass some value to a leanmodal popup?

Maybe there is a PHP native way to open modal popup but I don't know how ...

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Link to comment
Share on other sites

Add either a path, or the full URL as the href to the <a> tag. It's almost guaranteed that the plugin is using the value in the href as the source of the contents for the window, and your query string alone isn't enough information to be able to do that.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.