Use Fancybox
your problem will be solved. [Download] the package first. Then include the CSS
and JS
in your template.1
Usage:
<a href="<?=base_url()?>home/login/" class="fancybox">Login</a>
$(function(){
$(".fancybox").fancybox({
type : 'iframe',
autoSize : false,
width : "60%",
height : "56%",
'scrolling' : 'no',
'titleShow' : false,
openEffect : 'fade',
closeEffect : 'fade'
});
});
EDIT
Changes :
added the fancybox
class in the link.
<a href="<?php echo base_url()?>index.php/blog/ajax_dislike/?dislikeid=<?php echo $row ->id;?>" class="fancybox">Dislike</a>
Mandatory includes in the <head>
section of the index page:
<script type="text/javascript" src="<?=base_url()?>js/jquery-1.9.1.js"></script>
<link rel="stylesheet" href="<?=base_url()?>css/fancybox/jquery.fancybox.css" />
<script type="text/javascript" src="<?=base_url()?>js/jquery.fancybox.js"></script>
Now in the page in the <head>
section include this after the above includes:
<script type="text/javascript">
$(function(){
$(".fancybox").fancybox({
type : 'iframe',
autoSize : false,
width : "60%",
height : "56%",
'scrolling' : 'no',
'titleShow' : false,
openEffect : 'fade',
closeEffect : 'fade'
});
});
</script>