CodeIgniter Forums
Open JQuery Popup? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: Open JQuery Popup? (/showthread.php?tid=43877)

Pages: 1 2


Open JQuery Popup? - El Forum - 07-26-2011

[eluser]ShawnMA[/eluser]
I'm working with HTML/Jquery code that our designer passed over to me so that I can integrate CI into it. The problem I'm having is that certain links use jquery to pop open shadow boxes, but once put into CI these no longer work. If I point the link to a controller, then load the pop up view, it simply loads the pop as an entire page, not a simple shadow box.

I've tried searching for a solution, but its unclear what needs to be done. Any assistance is greatly appreciated. Thanks.

A code snippet from my view is as follows:


Code:
[removed]
$(function(){
$('form').jqTransform();
});
$(window).load(function  () {
$(".join-button a").fancybox().trigger('click');
});
[removed]

Code:
<li class="join-button"><a href="pupup1.html">join</a></li>



Open JQuery Popup? - El Forum - 07-26-2011

[eluser]John_Betong_002[/eluser]
Search the User Guide for anchor_popup():

http://ellislab.com/codeigniter/user-guide/helpers/url_helper.html
&nbsp;
&nbsp;


Open JQuery Popup? - El Forum - 07-26-2011

[eluser]ShawnMA[/eluser]
Thanks. Will this load the popup page as it is currently designed, or do I need to specify size attributes? In other words, as it stands, when using the code provided by the designer, the pop up opens perfectly (centered, sized-right, etc). Thanks!


Open JQuery Popup? - El Forum - 07-26-2011

[eluser]John_Betong_002[/eluser]
[quote author="ShawnMA" date="1311747501"]Thanks. Will this load the popup page as it is currently designed, or do I need to specify size attributes? In other words, as it stands, when using the code provided by the designer, the pop up opens perfectly (centered, sized-right, etc). Thanks!
[/quote]

Did you read the User Guide?

Code:
$atts = array(
              'width'      => '800',
              'height'     => '600',
              'scrollbars' => 'yes',
              'status'     => 'yes',
              'resizable'  => 'yes',
              'screenx'    => '0',
              'screeny'    => '0'
            );

echo anchor_popup('news/local/123', 'Click Me!', $atts);
Note: The above attributes are the function defaults so you only need to set the ones that are different from what you need. If you want the function to use all of its defaults simply pass an empty array in the third parameter:

echo anchor_popup('news/local/123', 'Click Me!', array());
&nbsp;


Open JQuery Popup? - El Forum - 07-27-2011

[eluser]ShawnMA[/eluser]
I did read the guide. When using the anchor_pop, regardless of the attributes I assign it, it still doesn't look right. Is there an easier way to simply call the Jqeury function that opens the page I want?


Open JQuery Popup? - El Forum - 07-27-2011

[eluser]John_Betong_002[/eluser]
Can you supply the code you used that "doesn't look right" and also a screen dump of what you expect.

Without having all your code I cannot suggest any other means of simply calling a jQuery function.
&nbsp;
&nbsp;


Open JQuery Popup? - El Forum - 07-27-2011

[eluser]ShawnMA[/eluser]
Screenshot attached, along with code from popup. Calling code is below. Thanks!

View code:

Code:
&lt;?php
$atts = array(
//              'width'      => '800',
//              'height'     => '600',
              'scrollbars' => 'no',
//              'status'     => 'yes',
//              'resizable'  => 'yes',
//              'screenx'    => '0',
//              'screeny'    => '0'
);
?&gt;

<li class="join-button">&lt;?php echo anchor_popup('public_home/openPop', 'join', $atts); ?&gt;</li>


Controller:

Code:
public function openPop(){
          $this->load->view('pupup1');
        }



Open JQuery Popup? - El Forum - 07-27-2011

[eluser]ShawnMA[/eluser]
Error shown in attached.


Open JQuery Popup? - El Forum - 07-27-2011

[eluser]John_Betong_002[/eluser]
[quote author="ShawnMA" date="1311797751"]Error shown in attached.[/quote]

Try this:
Code:
&lt;?php
$atts = array(
              'width'      => '300',
              'height'     => '200',
              'scrollbars' => 'no',
              'status'     => 'no',
              'resizable'  => 'yes',
              'screenx'    => '200',
              'screeny'    => '200'
);
?&gt;
<li class="join-button">&lt;?php echo anchor_popup('public_home/openPop', 'join', $atts); ?&gt;</li>
  

// Controller:
public function openPop(){
          $this->load->view('pupup1');
        }
&nbsp;
&nbsp;


Open JQuery Popup? - El Forum - 07-27-2011

[eluser]ShawnMA[/eluser]
Thanks but no luck. I still get the same result, only in a smaller window. Plus in Firefox, it shows the address bar.