Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => Images

Open image in popup while click on text

images php coding issues or problems here.

Moderators: macek, egami, gesf

Open image in popup while click on text

Postby phpkiller » Wed Jul 03, 2013 5:01 am

First Put This code in your page:
<script language="javaScript" type="text/javascript">
function runme(priceval){
newprice1 = 0;
if(document.getElementById("option_oc_range").value != ''){
newprice1 = eval(parseInt(priceval)+parseInt(document.getElementById("option_oc_range").value));
} else {
newprice1 = parseInt(priceval);
}
document.getElementById("amount").value = '$' + newprice1;
}
</script>
<script language="javaScript" type="text/javascript">

var newwindow = '';
function popitup(url) {
if (newwindow.location && !newwindow.closed) {
newwindow.location.href = url;
newwindow.focus();
} else {
newwindow=window.open(url,'htmlname','width=700,height=650,resizable=1, left=250');}
}

function tidy() {
if (newwindow.location && !newwindow.closed) {
newwindow.close();
}
}
</script>

Now put This code in your HTML text:
<a href="javascript:popitup('images/myimage.jpg')">night vision lighting comparison chart</a>
phpkiller
New php-forum User
New php-forum User
 
Posts: 30
Joined: Thu Jun 28, 2012 2:11 pm

Re: Open image in popup while click on text

Postby johnj » Mon Jul 08, 2013 2:56 am

So, what is the error that you are getting while opening the image in a popup?
johnj
php-forum Super User
php-forum Super User
 
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm


Return to PHP coding => Images

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron