473,394 Members | 1,797 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Javascript SearchBar

I aren't sure if this this possible, please could an expert advise?

I have a table that when clicked (an image inside a cell) expands to show a
larger area that will house a search facility, but I wanted the table to
expand slowly almost like it was sliding down (like when you click the
Organise button on the outlook toolbar!), can this be done? I've knocked
something up that is representative of what I was trying to achieve at work
yesterday, I've added 1px borders around the tables so that you can easily
see what is going on, the code works and expands the "search bar" as I am
calling it but if I can make it slide easily I would like to for the visual
appeal it would bring, anyway code below;

<HTML>
<HEAD>
<TITLE>Test</TITLE>
<SCRIPT LANGUAGE=javascript>
<!--

var flag;
var minSize;
var maxSize;

function setPresets(){

flag = false;
minSize = 25;
maxSize = 125;
switchView();

}

function switchView(){

if (flag == false){
for (var i = minSize; i < maxSize; i++){
adjustHeight(i);
}
searchForm.style.display = "block";
flag = true;
}else{
for (var i = maxSize; i > minSize; i--){
adjustHeight(i);
}
searchForm.style.display = "none";
flag = false;
}
}

function adjustHeight(height){
pauseComp(10);
searchBar.height = height;
}

function pauseComp(millis){
// www.sean.co.uk
date = new Date();
var curDate = null;
do{var curDate = new Date();}
while(curDate-date < millis);
}

//-->
</SCRIPT>
</HEAD>
<BODY onLoad="setPresets();">
<TABLE id="searchBar" name="searchBar" width="100%" height="25"
cellpadding="3" cellspacing="0" border="1">
<TR>
<TD align="right" valign="top">
<IMG SRC="file://C:\Inetpub\wwwroot\web.gif" onClick="switchView();">
<TABLE id="searchForm" align="center" width="500" cellspacing="0"
cellpadding="3" border="1">
<TR>
<TD colspan="2">Search facility below...</TD>
</TR>
<TR>
<TD align="right">Term you seek?</TD>
<TD></TD>
</TR>
<TR>
<TD><INPUT type="submit" value="Submit" id="btnSubmit"
name="btnSubmit"></TD>
<TD><INPUT type="reset" value="Reset" id="btnReset"
name="btnReset"></TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>

the pauseComp method I got off a site on the net when I thought adding a
pause would help me, thanks to anyone who takes a look at this and replies,

regards,
J.
Oct 22 '05 #1
2 1776
VK

John wrote:
I have a table that when clicked (an image inside a cell) expands to show a
larger area that will house a search facility, but I wanted the table to
expand slowly almost like it was sliding down (like when you click the
Organise button on the outlook toolbar!), can this be done?
How about:
<http://www.dynamicdrive.com/dynamicindex1/outbar2/index.htm>

the pauseComp method I got off a site on the net when I thought adding a
pause would help me, thanks to anyone who takes a look at this and replies,


the pauseComp is not posted (only the first few lines). Overall one
usually uses timed someObject.style.clip property change to imitate the
roll-out effect.

Oct 22 '05 #2
Thanks VK


"VK" <sc**********@yahoo.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...

John wrote:
I have a table that when clicked (an image inside a cell) expands to show
a
larger area that will house a search facility, but I wanted the table to
expand slowly almost like it was sliding down (like when you click the
Organise button on the outlook toolbar!), can this be done?


How about:
<http://www.dynamicdrive.com/dynamicindex1/outbar2/index.htm>

the pauseComp method I got off a site on the net when I thought adding a
pause would help me, thanks to anyone who takes a look at this and
replies,


the pauseComp is not posted (only the first few lines). Overall one
usually uses timed someObject.style.clip property change to imitate the
roll-out effect.

Oct 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jarod_24 | last post by:
I got a application who's GUI is basically a textfield. Usually the program lies just above my taskbar, but then i thought; why not make it into a toolbar that i can put on the taskbar. The thing...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.