SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    Non-Member GlobalFusion's Avatar
    Join Date
    Jul 2004
    Location
    globalfusion.com.au Google PageRank: 5
    Posts
    128
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Floating Text Box

    Hi,

    I have a table with rows filled with data from a DB.

    -------------------------------------------------------------
    | Field 1 | Field 2 | Field 3 | Field 4 | Field 5 | IMAGE | Field 6 |
    -------------------------------------------------------------

    What I am trying to do, is create a floating text box using z-index, that is only visible when hovering on the IMAGE. I want it to hover on the right, over 'Field 6' (hence the z-index).

    Basically, im trying to recreate the 'ALT' text effect you get with text-links.

    The only difference is that i will be dynamically populating that text box for each record extracted from the DB.


    So far, my attempts have gotten me the text box doing everything i want except for actually displaying the text (using a php 'echo' for a pre-set variable), and as the 'IMAGE' was hovered on each record, the 'empty' text box would only show on the first record. (ie, hover over IMAGE on record 5, and the text box appears next to 'IMAGE' on record 1)


    I hope thats not too confusing.. I'm tired. its been buggin the hell out of me for the past few hours now.


    Any help appreciated.
    Last edited by GlobalFusion; Oct 6, 2004 at 08:34.

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,556
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    I'm not quite sure if this is the sort of thing you are looking for but it might help.

    http://www.pmob.co.uk/temp/popupmessagecss3.htm

    The code should be self-explanatory but if its any good and you need help then just shout

    Paul

  3. #3
    SitePoint Enthusiast
    Join Date
    Aug 2004
    Location
    ohio
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well I don't know about the way your are trying to do the solution but why not just dynamically insert the content into the title attribute?

    For example with PHP

    <?php

    $db = SELECT * FROM foo
    $db_result = blah blah blah

    $image = $db_result['image'];
    $title = $db_result['title'];

    If (isset($image))
    {
    print <<<html

    <img src="{'$image'}" alt="{'$title'}" />

    html;

    }

    ?>

    Now the above code is not workable code but it gives you the idea somewhat on how you can dynamically input the title into the alt text etc. I'm sure given the principal of how to set it up you can pretty much figure it out from there. I'm not much of a PHP coder! Just a wee little newbie
    HTH

    Michael

  4. #4
    Non-Member GlobalFusion's Avatar
    Join Date
    Jul 2004
    Location
    globalfusion.com.au Google PageRank: 5
    Posts
    128
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Paul O'B
    Hi,

    I'm not quite sure if this is the sort of thing you are looking for but it might help.

    http://www.pmob.co.uk/temp/popupmessagecss3.htm

    The code should be self-explanatory but if its any good and you need help then just shout

    Paul
    Perfect.


    Thankyou.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •