Advertisement:

Author Topic: image preview in search page  (Read 2650 times)

ingo

  • Full Member
  • ***
  • Posts: 216
image preview in search page
« on: January 06, 2012, 09:53:12 pm »
I think image (mouse over / click)  preview in search list would be nice extension,

Does anyone knows a simple script?

Thanks
« Last Edit: January 08, 2012, 11:04:36 am by ingo »

ingo

  • Full Member
  • ***
  • Posts: 216
Re: image preview in search page
« Reply #1 on: January 07, 2012, 12:17:42 am »
« Last Edit: January 08, 2012, 11:05:12 am by ingo »

Jesse

  • Hero Member
  • *****
  • Posts: 631
  • Out of my mind, back in 5 minutes
Re: image preview in search page
« Reply #2 on: January 08, 2012, 05:30:51 pm »
Hi Ingo,

I just wanted to say I think this is a nice customization. I did play with it the other day for about an hour trying to get it to work. I was obviously not doing something right, but I'll play with it some more when I get time. I've been busy ALL day launching another site for a friend.  Tomorrow, I should be back to OSClass! :)

ingo

  • Full Member
  • ***
  • Posts: 216
Re: image preview in search page
« Reply #3 on: January 08, 2012, 05:55:18 pm »
solved

Hi,

I found simple solution I'll post tomorow obaut it

regards
« Last Edit: January 08, 2012, 06:34:33 pm by ingo »

Jesse

  • Hero Member
  • *****
  • Posts: 631
  • Out of my mind, back in 5 minutes
Re: image preview in search page
« Reply #4 on: January 09, 2012, 03:42:51 pm »
Hi Ingo,

I've got a demo of the mouse-over image preview working here: http://ivcity.com/osclass/ ..... it works on the Latest Items at the bottom of the main page. I also add this to the Item page as well. (if you see double-images, it just means you need to hit 'reload' on your browser to refresh the css file).

Original code shown here: http://sonspring.com/journal/hoverbox-image-gallery .... the key to making this work is placing the css code at the bottom of your style.css file.


I've also attached some before/after mouse-over images here, including one of the Item page (in the picture I accidentally put the fake yellow mouse over the wrong image, but you get the idea!)...
« Last Edit: January 09, 2012, 05:31:31 pm by Jesse »

RajaSekar

  • Hero Member
  • *****
  • Posts: 791
  • ராஜசேகர்
Re: image preview in search page
« Reply #5 on: January 09, 2012, 06:40:38 pm »

@Jesse

Nice idea

Keep up your good work.

seven

  • Jr. Member
  • **
  • Posts: 73
Re: image preview in search page
« Reply #6 on: January 09, 2012, 07:14:08 pm »
Hi Jesse.

Very good idea.

I've tried to change the code, but I have mistakes (error...).
Can you make a plugin or give better details how to do it please :)

Thanks in advance for your help :)


ingo

  • Full Member
  • ***
  • Posts: 216
Re: image preview in search page
« Reply #7 on: January 09, 2012, 10:04:23 pm »
just great!!!

that's what we need - ad classifieds project needs good picture features

Thanks Jesse!


Jesse

  • Hero Member
  • *****
  • Posts: 631
  • Out of my mind, back in 5 minutes
Re: image preview in search page
« Reply #8 on: January 10, 2012, 04:45:29 am »
Thanks guys, but this was ingo's idea!  :) I was just helping him get it working.


As far as details... absolutely!

How it works: this method displays two images... one remains in-line with your page, the other is set on a separate z-index (layer) when the user hovers over it.


Here is the CSS code to place at the end of your style.css file:
Code: [Select]
/* Hoverbox Code
----------------------------------------------------------------------*/
.hoverbox {cursor: default; list-style: none; }
.hoverbox a { cursor: default; }
.hoverbox a .preview { display: none; }
.hoverbox a:hover .preview { display: block; position: absolute; top: -50px; left: -70px; z-index: 1; }
.hoverbox img { background: #fff; color: inherit; padding: 2px; vertical-align: top; width: 100px; height: 75px; }
.hoverbox li { background: #eee; color: inherit; display: inline; float: left; margin: 1px; padding: 1px; position: relative; }
.hoverbox .preview { border-color: #000; width: 240px; height: 200px; }


Here is a very simplistic HTML code showing the basics of what's needed:
Code: [Select]
<ul class="hoverbox">
<li>
<a href="#"><img src="img/photo01.jpg" alt="description" /><img src="img/photo01.jpg" alt="description" class="preview" /></a>
</li></ul>



And here is an actual code example from the file main.php, Latest Ads section, using BCute theme:
Code: [Select]
                                            <td class="photo">
      <ul class="hoverbox"><li>
                                                <?php if( osc_item_is_premium() ){ ?>
                                                <div id="premium_img"></div>
                                                <?php }?>
                                                <?php if( osc_count_item_resources() ) { ?>
                                                <a href="<?php echo osc_item_url() ; ?>">
                                                    <img src="<?php echo osc_resource_thumbnail_url() ; ?>" width="75px" height="56px" title="" alt="" />
                                                    <img src="<?php echo osc_resource_thumbnail_url() ; ?>" width="75px" height="56px" title="" alt="" class="preview" />
                                                </a>
                                                <?php } else { ?>
                                                    <img src="<?php echo osc_current_web_theme_url('images/no_photo.gif') ; ?>" alt="" title=""/>
                                                <?php ?>
      </li></ul>
                                            </td>
« Last Edit: January 10, 2012, 05:00:40 pm by Jesse »

seven

  • Jr. Member
  • **
  • Posts: 73
Re: image preview in search page
« Reply #9 on: January 10, 2012, 04:36:02 pm »
Ingo Great idea!

Jess you're my number ONE for today!!

I tested with the details given and it works!

:)