Announcement

Collapse
No announcement yet.

[WEBMASTER] script for new window or table ?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • [WEBMASTER] script for new window or table ?

    Hi

    I try to do something like here http://www.isohunt.com/torrents/?ihq=atlantis

    when you click on file then appear new "window or table" I don't know is it PHP or java, or asp :/

    I thinks same option is made on ebay when you go with mouse over picture and it make for you view without cliking on it


    If someone know how is it made (the best solution would be in java or php, but not with asp, asp.net)

    Thanks

  • #2
    Re: [WEBMASTER] script for new window or table ?

    I'm sorry I do not understand your English very well. Can I ask - do you want the table to expand out one line and show more detail when the user clicks on one entry? So that table just shows a grid of data, and then when the user clicks on one item, it becomes larger and shows more detail about that item?

    If that is what you mean, it can be done in Javascript by hiding and showing DIVs, by setting the style.display property.

    Usually, to display the data in the table in the first place, the data would be taken from a database query, which can be done using PHP/mySQL.

    If I have misunderstood, I apologise.
    Best wishes,
    PaulH.
    MCP:Server 2003; MCITP:Server 2008; MCTS: SBS2008

    Comment


    • #3
      Re: [WEBMASTER] script for new window or table ?

      Originally posted by PaulH View Post
      I'm sorry I do not understand your English very well. Can I ask - do you want the table to expand out one line and show more detail when the user clicks on one entry? So that table just shows a grid of data, and then when the user clicks on one item, it becomes larger and shows more detail about that item?

      If that is what you mean, it can be done in Javascript by hiding and showing DIVs, by setting the style.display property.

      Usually, to display the data in the table in the first place, the data would be taken from a database query, which can be done using PHP/mySQL.

      If I have misunderstood, I apologise.

      Hi that what I meant. I've been looking some script for that to use it as example

      Comment


      • #4
        Re: [WEBMASTER] script for new window or table ?

        If you google the words javascript show hide DIV or the words javascript display.visibility you can see some examples.

        I cannot post you all of my script, because it contains commercially sensitive information, sorry. but there are many examples on google if you search for those keywords.

        here is a snippet to get you started, which displays textual articles with titles (that always show) and content (the content is hidden or shown depending on whether the user has clicked on an icon which is a plus or minus sign):
        Code:
        <script type="text/javascript">
        function toggleVisibility(id) {
        	var img = document.getElementById('plusminus'+id);
        	var text = document.getElementById('text'+id);
        	if (text.style.display != 'block') {
        		img.src = "images/minus.gif";
        		text.style.display = 'block';
        	} else {
        		img.src = "images/plus.gif";
        		text.style.display = 'none';
        	}
        }
        // if js is disabled we want text elements to be visible
        // so they are visible by default in the CSS.  This makes them invisible
        //providing js is enabled:
        document.write("<" + "style type='text/css'>.text{display:none;}<" + "/" + "style>");
        </script>
        and in the body of the web page, in php, I have a little "Plus or minus" sign image that changes from a plus to a minus when the DIV is expanded, and back to a plus when it is contracted. Here's what I do in PHP, where $kbid contains the ID number of the record in the mySQL database, $title is the title of the article and this is alway displayed, and $content is the text that shows or is hidden in the DIV:
        Code:
        $html = "<p><img src=\"images/plus.gif\" border=\"0\" ";
        $html .= "id=\"plusminus".$kbid."\" ";
        $html .= " class=\"plusminus\" onclick=\"toggleVisibility('".$kbid."')\" />";
        $html .= "<a href=\"#\" onclick=\"toggleVisibility('".$kbid."')\">Article ".$title."</a>";
        $html .= "<div id=\"text".$kbid."\" class=\"text\">";
        $html .= $content."<hr /></div></p>";
        print $html;
        The variables in the php script are filled with values by reading records in from a database, which I assume you know how to do, and all of the PHP code is in a loop to display a list of titles (with a plus sign icon next to each one). When the user clicks the plus sign, the article content is shown and the icon changes to a minus sign.

        I realise it is not a complete solution for you, but I cannot post any more code. So use this as a starting point and look on the web for other examples to give you something to work on.
        Best wishes,
        PaulH.
        MCP:Server 2003; MCITP:Server 2008; MCTS: SBS2008

        Comment


        • #5
          Re: [WEBMASTER] script for new window or table ?

          Thank you very much.

          that is perfect example. When I did not know what to looking for I check ajax to early for ajax with my knowledge.

          Now when you give me clue what to looking for I could try more research. Thanks

          Comment

          Working...
          X