How to call the div,, Please help me out
Moderator: General Moderators
How to call the div,, Please help me out
Dear All,
As my client want the functionality same as in the URL:
http://www.cleartrip.com/flights/result ... &x=17&y=10
when u open this link a data page opened which have a button "Details" after click on this button related data shown just below the prefetched data and so on....
i have no problem with showing the data from data base, but my problem is that i m not able to Generate the Show/Hide Div i tried lot but not success.
Can any one please give me any idea how to do this in PHP.
i m eagerly waiting for Yr. Replies? Plz Plz Help.....
As my client want the functionality same as in the URL:
http://www.cleartrip.com/flights/result ... &x=17&y=10
when u open this link a data page opened which have a button "Details" after click on this button related data shown just below the prefetched data and so on....
i have no problem with showing the data from data base, but my problem is that i m not able to Generate the Show/Hide Div i tried lot but not success.
Can any one please give me any idea how to do this in PHP.
i m eagerly waiting for Yr. Replies? Plz Plz Help.....
Re: How to call the div,, Please help me out
It doesn't matter how eager you are, you can still take 5 seconds to at least try to post in the correct category.
Moved.
Moved.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Re: How to call the div,, Please help me out
This is a JavaScript question.
Clicking a "details" link triggers a JavaScript routine that changes the CSS style or class of an HTML element containing the details and toggles the "display" style of that element from "none" to "block" or something appropriate.
Edit: This post was recovered from search engine cache.
Clicking a "details" link triggers a JavaScript routine that changes the CSS style or class of an HTML element containing the details and toggles the "display" style of that element from "none" to "block" or something appropriate.
Edit: This post was recovered from search engine cache.
Last edited by McInfo on Thu Jun 17, 2010 1:11 pm, edited 1 time in total.
Re: How to call the div,, Please help me out
You can try this link to do the javascript and css http://taufin-in-work.blogspot.com/2009 ... ed-my.html
-
anasmuhammed
- Forum Newbie
- Posts: 2
- Joined: Fri Oct 30, 2009 9:57 pm
Re: How to call the div,, Please help me out
Try This Javascript
or
function show should be triggered onclick event of show button
function hide should be triggered onclick event of hide button
object to be displayed or hidden should be passed as argument or try getting object in javascript using following code in javascript itself
-Regards
-ima
Code: Select all
function hide(object)
{
object.style.visibility="hidden";
object.style.position="absolute";
}
Code: Select all
function show(object)
{
object.style.visibility="visible";
object.style.position="relative";
}
function hide should be triggered onclick event of hide button
object to be displayed or hidden should be passed as argument or try getting object in javascript using following code in javascript itself
Code: Select all
var obj=document.getElementById('id of object to be hidden');-Regards
-ima
-
rajeevbharti
- Forum Newbie
- Posts: 12
- Joined: Fri Oct 30, 2009 12:43 am
- Location: Delhi
Re: How to call the div,, Please help me out
anasmuhammed wrote:Try This Javascript
orCode: Select all
function hide(object) { object.style.visibility="hidden"; object.style.position="absolute"; }function show should be triggered onclick event of show buttonCode: Select all
function show(object) { object.style.visibility="visible"; object.style.position="relative"; }
function hide should be triggered onclick event of hide button
object to be displayed or hidden should be passed as argument or try getting object in javascript using following code in javascript itself
Code: Select all
var obj=document.getElementById('id of object to be hidden');
thanks we need also this code. Thanks for posting the code ........
-Regards
-ima
Re: How to call the div,, Please help me out
Hi,s1auk14 wrote:You can try this link to do the javascript and css http://taufin-in-work.blogspot.com/2009 ... ed-my.html
Thnks for reply, but my form have dynamic data i mean data pulled from the data base and only one "Div" tag repeated for all the data so this is not effective, its effective only when we have static Div i mean Form which swos the data know How many Dives are.
Please Reply
For More Please see this code:
<?
$result=QUERY RESULT;
while($object=mysql_fetch_object($resulty) ) {?>
<div>
<div>
<? $object ->question?>
</div>
<div>+Details</div>
</div>
<? }?>
on click this "+Details" another div open just below the clicked parent Div and show the additional information .......
Please Help Me Out
Re: How to call the div,, Please help me out
McInfo wrote:This is a JavaScript question.
Clicking a "details" link triggers a JavaScript routine that changes the CSS style or class of an HTML element containing the details and toggles the "display" style of that element from "none" to "block" or something appropriate.
Hi,
Thnks for reply, but my form have dynamic data i mean data pulled from the data base and only one "Div" tag repeated for all the data so this is not effective, its effective only when we have static Div i mean Form which swos the data know How many Dives are.
Please Reply
For More Please see this code:
<?
$result=QUERY RESULT;
while($object=mysql_fetch_object($resulty) ) {?>
<div>
<div>
<? $object ->question?>
</div>
<div>+Details</div>
</div>
<? }?>
on click this "+Details" another div open just below the clicked parent Div and show the additional information .......
Please Help Me Out
-
socalocmatt
- Forum Newbie
- Posts: 15
- Joined: Tue Nov 03, 2009 12:45 pm
Re: How to call the div,, Please help me out
Use the functions already posted and create the id dynamically and reference it in your link to show/hide
Then have the dynamically created link be some like:
edit:
ok so for some reason the forum wont let me put javascript next to a : so in the code above replace javascript & #058 with javascript:
Code: Select all
<?
$result=QUERY RESULT;
while($object=mysql_fetch_object($resulty) ) {
$i++
?>
<div>
<div>
<? $object ->question?>
</div>
<div id='<? echo $i; ?>'>+Details</div>
</div>
<? } ?>
Code: Select all
<a href="javascript:show(<? echo $i; ?>); return false;">Show</a>ok so for some reason the forum wont let me put javascript next to a : so in the code above replace javascript & #058 with javascript:
-
rajeevbharti
- Forum Newbie
- Posts: 12
- Joined: Fri Oct 30, 2009 12:43 am
- Location: Delhi
Re: How to call the div,, Please help me out
s1auk14 wrote:You can try this link to do the javascript and css http://taufin-in-work.blogspot.com/2009 ... ed-my.html
thanks for providing this link. it is helpful for me ...........