 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
Light
Joined: 23 Oct 2009 Posts: 13 Location: Ozarks
|
Posted: Fri Oct 23, 2009 1:18 am Enlarging an entire table onclick of button |
|
|
|
I have a webpage designed for class, involving a table with cells that are 4 columns and three rows in dimension.
My question is, I want the user to be able to click on a button and enlarge the entire table.
I would prefer not to use a "<a href=" if possible,
but I would entertain any and all ideas on how to code for such an enlargement. |
|
sticks464

Joined: 31 Dec 2006 Posts: 2625
|
Posted: Fri Oct 23, 2009 6:47 am |
|
|
|
You can use javascript to enlarge and decrease size. Look at the numbers in this example and you should be able to get what you want. However it does not increase the size of text or other objects inside the table.
Put this in the head section
| Code: |
<script type="text/javascript">
function adjust(inp)
{
var vid=document.getElementById('table1'); // ID of your embed tag
if(inp.value.toLowerCase()=='enlarge')
{
inp.value='Decrease'; // Change the textbox's value to 'Decrease'.
vid.style.width='800px'; // Adjust the width to Npx.
vid.style.height='450px'; // Adjust the height to Npx.
}
else
{
inp.value='Enlarge'; // Change the textbox's value to 'Enlarge'.
vid.style.width='528px'; // Adjust the width to Npx.
vid.style.height='150px'; // Adjust the height to Npx.
}
}
</script> |
table and button
| Code: |
<input type="button" value="Enlarge" onclick="adjust(this)">
<table id="table1" width="528" height="150" border="1" cellspacing="2" cellpadding="5">
<tr>
<td valign="top" valign="top">Some text</td valign="top">
<td valign="top">Some text</td valign="top">
<td valign="top">Some text</td valign="top">
<td valign="top">Some text</td valign="top">
</tr>
<tr>
<td valign="top">Some text</td valign="top">
<td valign="top">Some text</td valign="top">
<td valign="top">Some text</td valign="top">
<td valign="top">Some text</td valign="top">
</tr>
<tr>
<td valign="top">Some text</td valign="top">
<td valign="top">Some text</td valign="top">
<td valign="top">Some text</td valign="top">
<td valign="top">Some text</td valign="top">
</tr>
</table> |
|
|
Light
Joined: 23 Oct 2009 Posts: 13 Location: Ozarks
|
Posted: Mon Oct 26, 2009 9:55 pm Thankyou, and have another subject questions: Banners. |
|
|
|
Thankyou, Stick,
I'll get back to you a day or two. Have mid term in Web class and need to check out the code for myself.
I'm onto a new subject. Banners that rotate using images(jpeg/gifs)
Been research the web and have not found anything that sufficiently explains the coding process for HTML. At this point i'm assuming a javascript application of some sort.
So, how do I begin to code for such? If i'm linking to another page is it HTML or CSS? If in either one are all of my images, say 5 to 10 are they in/on the same page? Questions like that. Also, timing is an obvious issue. I'm mostly curious, but not required for class. Thanks again. Light. |
|
sticks464

Joined: 31 Dec 2006 Posts: 2625
|
Posted: Tue Oct 27, 2009 3:43 am |
|
|
|
Anything that moves, rotates, twinkles etc. is considered dynamic content and requires either javascript, php or ajax to make the effect. Depends on what you want to use as to what you can find. Some scripts let the images rotate on a timed setting and some rotate upon page load or reload.
Here's a nice javascript one.
Instructions here. |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|
|
 |
|
|
|
|
|
|
|