Jump to content

Click-to-show


Eminem

Recommended Posts

Your problem can be solved with DIV layers...

 

Instead of href use onClick or onMouseOver (up to you ... what you like most) and onClick call JS ...

 

You should define div layer with height '0' and positioning to absolute and overflow should be disabled.

 

In JS you should resize this layer to whatever you want..

 

With a little knowledge about JS you should understand code below:

 

<script type="text/javascript">
var o;
function big(n, obj)
{
setTimeout('bigcall("'+n+'")', 0);
}
function bigcall(n)
{
	var obj = document.getElementById('im');
	o.innerHTML = '<img src="'+n+'" />';
	o.style.left = (obj.offsetWidth - 10) + "px";
	o.style.top = (obj.offsetHeight - 10) + "px";
	o.style.visibility = 'visible';		
}

function big_hide()
{
setTimeout('big_hide1()', 1000);
}

function big_hide1(num)
{
o.style.visibility = 'hidden';
}

function init()
{
o = document.getElementById('ro');
}
</script>

 

This is made for pictures:

"bigcall('path_to_picture')" Use this in onClick to call function bigcall...

 

In body must be defined:

onload="init();"

 

This will make o (look in script)..

 

And div layer must be defined with ID (in this case 'ro')

<div id="ro" style="visibility:hidden; position:absolute;"></div>

 

With this script you should solve your problem with a few modifications.

 

In function bigCall there is timeout function ... This is used if you want a little delay when mouse goes over.

 

If you have any problems feel free to ask...

 

This code is just a quick example.. I hope it will help you...

 

Best regards,

EW

Link to comment
https://forums.phpfreaks.com/topic/42892-click-to-show/#findComment-208327
Share on other sites

Although I don't imagine what exactly you want to do I think it can be easily done ...

 

Text should be hidden and in div (same div as picture) than on click text should be set to proper size and shown and layer should be set to auto width and height ...

 

You can describe a little bit more (is there any example, picture) and I will help tomorrow (will be away now - sleep time :) ) if you are not successful today. 

 

Best regards

Link to comment
https://forums.phpfreaks.com/topic/42892-click-to-show/#findComment-208355
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.