Datalist with images

Last post 07-04-2009 10:39 AM by polachan. 3 replies.

Sort Posts:

  • Datalist with images

    06-06-2009, 6:25 AM
    • Member
      603 point Member
    • friend.amee
    • Member since 06-30-2008, 8:16 AM
    • Rajkot
    • Posts 185

    I am using Datalist to display images from database.

    Now i want mouseover effect on all images.

    i want to saw image in big size when user puts mouse on any image.

    Can any one tell me how to do this??

    Amee
    mark as answer if my reply helps you.
  • Re: Datalist with images

    06-06-2009, 9:06 AM
    Answer

     Check this sample .. try to do it with DataList.

     

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title></title>

    <style type="text/css">

    * {
    margin: 0;
    padding: 0;
    }

    body {
    margin: 0;
    padding: 30px;
    background: #FFF;
    color: #666;
    text-align: center;
    }

    h1 {
    font: bold 16px "Lucida Grande", Arial, sans-serif;
    }

    p {
    margin: 15px 0;
    font: 11px/1.5em "Lucida Grande", Arial, sans-serif;
    }

    a {
    color: #900;
    text-decoration: underline;
    }

    a:hover {
    background: #900;
    color: #FFF;
    text-decoration: none;
    }

    hr {
    margin: 24px 0;
    _margin: 0; /*IE Sucks*/
    clear: both;
    }

    #page-container {
    margin: 0 auto;
    width: 350px;
    text-align: left;
    }

    .pg {
    width: 350px;
    list-style: none none;
    }

    .pg:after {
    clear: both;
    display: block;
    content: ".";
    height: 0;
    visibility: hidden;
    }

    .pg li {
    list-style: none none;
    display: inline;
    }

    .pg li a {
    margin: 2px;
    border: 1px solid #CCC;
    padding: 4px;
    position: relative;
    float: left;
    display: block;
    width: 100px;
    height: 75px;
    }

    .pg li a:hover {
    font-size: 100%;
    z-index: 2;
    }

    .pg li a img {
    border: 0 none;
    position: absolute;
    width: 100px;
    height: 75px;
    }

    .pg li a:hover img,.pg li a:active img,.pg li a:focus img {
    width: 200px;
    height: 150px;
    left: -50px;
    top: -37px;
    z-index: 1;
    }

    </style>
    </head>
    <body>
    <div id="page-container">

    <hr />
    <ul class="pg">
    <li><a href="flowers.jpg"><img src="img1.jpg" alt="" /></a></li>
    <li><a href="flowers.jpg"><img src="img2.jpg" alt="" /></a></li>
    <li><a href="flowers.jpg"><img src="img3.jpg" alt="" /></a></li>
    <li><a href="flowers.jpg"><img src="img4.jpg" alt="" /></a></li>
    <li><a href="flowers.jpg"><img src="img5.jpg" alt="" /></a></li>
    </ul>
    <hr />


    </div>
    </body>
    </html>
      
    Plz remember to click "Mark as Answer" if this helped you.

    Abdulla AbdelHaq    MCTS, MCPD

    - My Articles on ASP Alliance
    - My Weblogs
    - My Sessions on JorDev User Group

    "Experience is simply the name we give our mistakes"
  • Re: Datalist with images

    06-07-2009, 7:46 AM
    • Participant
      1,508 point Participant
    • izharulislam
    • Member since 01-18-2009, 7:03 AM
    • Posts 296

    In  your datalist template you need to define onmouseover attribute for your images.

     

     

    Thanks & Regards,
    Izhar Ul Islam Khan
    Microsoft Certified Technology Specialist
  • Re: Datalist with images

    07-04-2009, 10:39 AM
    • Member
      14 point Member
    • polachan
    • Member since 07-23-2007, 5:37 AM
    • Posts 109

    I am using gridview  and and imagefield template. When I click imagefield I need to open a popup window  to show the imagae as enlarge. Please anybody can help with a sample code in girdview template field column to show an enlarge image on a gridview  in popupwindow .

    With thanks Pol

    Filed under:
Page 1 of 1 (4 items)