4images Forum & Community

General / Allgemeines => Chit Chat => Topic started by: impss on January 10, 2006, 06:19:47 PM



Title: JavaScript + CSS = Nice Picture Display
Post by: impss on January 10, 2006, 06:19:47 PM
This doesnt work for my needs , but I thought someone on here maybe able adapt it for there use.

http://www.huddletogether.com/projects/lightbox/

pretty nice way to display a picture


Title: Re: JavaScript + CSS = Nice Picture Display
Post by: mawenzi on January 10, 2006, 06:41:49 PM
indeed, a nice script ...  :D


Title: Re: JavaScript + CSS = Nice Picture Display
Post by: TheOracle on January 10, 2006, 11:50:49 PM
It might use more server ressources but still looks great. ;)


Title: Re: JavaScript + CSS = Nice Picture Display
Post by: V@no on January 11, 2006, 12:46:44 AM
O my! indeed nice! I think it would be nice display large image, instead of opening it in a new window :)

Wonder what browsers it supports?


Title: Re: JavaScript + CSS = Nice Picture Display
Post by: impss on January 11, 2006, 04:16:33 AM
Seems to be working in IE, Firefox , and Opera for me

V@no, or anyone

If you do something with this let us know. I might be able to use it in my gallery , if members cant right click on the image to save it
maybe make it so right click closes the picture to



Title: Re: JavaScript + CSS = Nice Picture Display
Post by: V@no on January 11, 2006, 07:22:21 AM
Well, I had problem implementing this script...I mean, implementing was a snap, but for some reason it didnt work for me. Turn out that onload function was not working correctly on my page...what is wierd, that it worked fine if I add something before <html> tag! so I had to abandom using onload feature and do initialization on mouse click. Actualy this method also prevent opening the image directly in the browser as it would happend if page was not fully loaded and you click on it.
example (http://gallery.vano.org/17880)

I'm not quiet sure if it was due to my modifications, or something else, but for some reason the "loading" image is not being centered on screen in firefox...in IE it looks good. time for debuging :)


Title: Re: JavaScript + CSS = Nice Picture Display
Post by: Vincent on January 11, 2006, 07:26:16 AM
yes looks nice!


Title: Re: JavaScript + CSS = Nice Picture Display
Post by: TheOracle on January 11, 2006, 12:38:24 PM
Quote  [Expand]

I'm not quiet sure if it was due to my modifications, or something else, but for some reason the "loading" image is not being centered on screen in firefox...in IE it looks good. time for debuging


Probably a mis-alignment between the two browsers - from the core's development. ;)


Title: Re: JavaScript + CSS = Nice Picture Display
Post by: Eagle Eye on January 21, 2006, 12:30:40 AM
here:
1
http://wiki.script.aculo.us/scriptaculous/show/CombinationEffects
   are some intresting effects you can add to the photo thumbnails, i liked the puff effect, but its seems to looks cool when all images have the same size,

 :D


Title: Re: JavaScript + CSS = Nice Picture Display
Post by: tdkpaul on August 17, 2006, 07:38:42 PM
Well, I had problem implementing this script...I mean, implementing was a snap, but for some reason it didnt work for me. Turn out that onload function was not working correctly on my page...what is wierd, that it worked fine if I add something before <html> tag! so I had to abandom using onload feature and do initialization on mouse click. Actualy this method also prevent opening the image directly in the browser as it would happend if page was not fully loaded and you click on it.
example (http://gallery.vano.org/17880)

I'm not quiet sure if it was due to my modifications, or something else, but for some reason the "loading" image is not being centered on screen in firefox...in IE it looks good. time for debuging :)

hey v@no

i use this lightbox
http://www.huddletogether.com/projects/lightbox2/

it works properly.
My question: It only should be activated if it is jpg, jpeg or gif.

How i can do this?

THX in Advance



Title: Re: JavaScript + CSS = Nice Picture Display
Post by: KurtW on August 17, 2006, 07:51:28 PM
Hi,

yes, i use this script a long time and i have no problem.... :wink:

http://www.malediven-bilder.de/categories.php?cat_id=124

cu
Kurt


Title: Re: JavaScript + CSS = Nice Picture Display
Post by: tdkpaul on August 17, 2006, 08:08:06 PM
edit

first problem fixed

ok erstes Problem gelöst


2nd Problem not fixed:

it only should be activated if it is jpg, jpeg and gif!

How i can do this?


Title: Re: JavaScript + CSS = Nice Picture Display
Post by: max.cady on September 11, 2006, 08:12:55 AM
Hi, can anybody tell me where to place the rel="lightbox" to activate the script?

I tried it with media/jpg.html
[qcode]<img src="{media_src}" border="1" alt="{image_name}"{width_height} rel="lightbox" /><br />[/qcode]

but it doesn't work this way on my site ...

What am I doing wrong?


Title: Re: JavaScript + CSS = Nice Picture Display
Post by: max.cady on September 12, 2006, 06:32:16 AM
can nobody tell me where to put the rel="lightbox"?


Title: Re: JavaScript + CSS = Nice Picture Display
Post by: mawenzi on September 12, 2006, 02:19:13 PM
Quote from: www.huddletogether.com   [Expand]
Add a rel="lightbox" attribute to any link tag to activate the lightbox.
For example:

<a href="images/image-1.jpg" rel="lightbox" title="my caption">image #1</a>

Link : http://www.huddletogether.com/projects/lightbox2/#support


Title: Re: JavaScript + CSS = Nice Picture Display
Post by: max.cady on September 12, 2006, 06:57:19 PM
ok, thanks ... can you tell me where I can find such a link in 4images? I couldn't find it in any html file so it is in any php file I suppose?
Could anybody tell me in which file I can find the relevant link where to put the lightbox reference to? Or is this insider knowledge only?  :?


Title: Re: JavaScript + CSS = Nice Picture Display
Post by: max.cady on September 12, 2006, 07:56:17 PM
Inspired by this thread
http://www.4homepages.de/forum/index.php?topic=9885.msg47995#msg47995

I got it to work on the details page by wrapping the {image} in the following tags
<a href="{media_src}" target="_blank" rel="lightbox">{image}</a>

However, I want it on the categories view that the lightbox opens if clicking on the thumbnail.
I tried the same trick with thumbnail_bit.html by wrapping the thumbnail in a href-tags and the rel="lightbox" tags but it won't work.

Any ideas how to get it work on the categories page?


Title: Re: JavaScript + CSS = Nice Picture Display
Post by: Daniela007 on November 14, 2006, 12:56:01 AM
Dieses Script schaut voll super aus.

Nur leider habe ich überhaubt keine Ahnung wie man sowas in die Galerie einbaut.

Hat wer ein Einbauhilfe in Deutsch? :D

Lg
Daniela


Title: Re: JavaScript + CSS = Nice Picture Display
Post by: Maweryk on March 01, 2007, 08:04:54 PM
Inspired by this thread
http://www.4homepages.de/forum/index.php?topic=9885.msg47995#msg47995

I got it to work on the details page by wrapping the {image} in the following tags
<a href="{media_src}" target="_blank" rel="lightbox">{image}</a>

However, I want it on the categories view that the lightbox opens if clicking on the thumbnail.
I tried the same trick with thumbnail_bit.html by wrapping the thumbnail in a href-tags and the rel="lightbox" tags but it won't work.

Any ideas how to get it work on the categories page?

Hat es einer bereits geschafft, die Lightbox in die categories.php einzubauen?
Wäre doch toll, wenn das Foto sich direkt nach dem Klick auf das Thumbnail über die Seite legen würde.
Für User, die kein JS aktiviert haben, würde dann wie gehabt die andere Seite aufgerufen werden.

Danke & Gruß

Markus


Title: Re: JavaScript + CSS = Nice Picture Display
Post by: mawenzi on March 01, 2007, 08:53:58 PM
Hat es einer bereits geschafft, die Lightbox in die categories.php einzubauen?

... hatte da schon jemand nachgefragt ... :wink:
... da "media_src" in der functions.php definiert wird, kannst du den Link (s.o.) auch um {thumbnail} in der thumbnail_bit.html legen ...
... und so funktioniert die "lightbox" auch in der index.php, search.php, categories.php und überall dort, wo die thumbnail_bit.html verwendet wird ...


Title: Re: JavaScript + CSS = Nice Picture Display
Post by: Maweryk on March 01, 2007, 09:07:25 PM
Dank Dir, aber es funktioniert leider nicht. :-(
Mein thumbnail_bit.html sieht nun so aus:
1
<a href="{media_src}" target="_blank" rel="lightbox">{thumbnail}</a>
Im Quellcode tauchen dann natürlich beide hrefs auf und er nimmt den alten Link:
1
<a href="./data/media/104/002.jpg" target="_blank" rel="lightbox"><a href="./image-3450.htm"><img src="./data/thumbnails/104/002.jpg" border="1" width="89" height="67" alt="002" /></a></a>

Was habe ich übersehen?

Danke & Gruß

Markus



Title: Re: JavaScript + CSS = Nice Picture Display
Post by: mawenzi on March 01, 2007, 11:29:46 PM
... dann probiere es zunächst nur mal mit einem einfachen Textlink in der thumbnail_bit.html aus ...
... das "thumbnail" in der functions.php müsste dann ohne Link definiert werden, um den Link wie oben zu verwenden ...


Title: Re: JavaScript + CSS = Nice Picture Display
Post by: Maweryk on March 02, 2007, 10:38:08 AM
Vielen Dank für Deinen Hinweis.
Als Textlink klappt es natürlich.
Wenn ich aber den Link aus der functions.php rausschmeiße, dann kommen User ohne JS leider nicht mehr auf die Ursprungsseite.
Wie wäre es denn, wenn man den Link in der thumbnail_bit.html in JS einbettet?

Gruß

Markus


Title: Re: JavaScript + CSS = Nice Picture Display
Post by: mawenzi on March 05, 2007, 03:56:57 PM
Wie wäre es denn, wenn man den Link in der thumbnail_bit.html in JS einbettet?

... kann ich nicht ganz nachvollziehen ...  :?


Title: Re: JavaScript + CSS = Nice Picture Display
Post by: KurtW on March 05, 2007, 04:08:49 PM
Hallo,

Und:
Quote  [Expand]
Für User, die kein JS aktiviert haben, würde dann wie gehabt die andere Seite aufgerufen werden.
stimmt so auch nicht. Da dieses Script im Link vom Bild integriert ist, öffnet sich ohne Javascript direkt das Bild, nicht eine page.

Es gibt zwar mit diesem Effect auch ein Script, das auch html öffnet, funktionierte aber bei meine Tests vor ca: 1 Jahr nicht so recht.



cu
Kurt


Title: Re: JavaScript + CSS = Nice Picture Display
Post by: Maweryk on April 03, 2007, 07:05:37 PM
Schade. :(

Gruß

Markus


Title: Re: JavaScript + CSS = Nice Picture Display
Post by: Alessio on April 09, 2007, 09:40:40 PM
I implemented Lightbox 2 on my web site http://www.webax.it ; it works with the thumbnails of new images in the home page and with the thumbnails of categories.php, but not with random images, top images, etc.
Furthermore, sometimes clicking on the thumbnails of categories.php/new images the details.php page or just the image opens instead of the lightbox.
 
Can you help me?

UPDATE: resolved


Title: Re: JavaScript + CSS = Nice Picture Display
Post by: jrey on April 10, 2007, 11:52:50 PM
I think it would be nice display large image, instead of opening it in a new window :)

Anybody Knows ?


Title: Re: JavaScript + CSS = Nice Picture Display
Post by: Alessio on June 30, 2007, 09:57:37 AM
Inspired by this thread
http://www.4homepages.de/forum/index.php?topic=9885.msg47995#msg47995

I got it to work on the details page by wrapping the {image} in the following tags
<a href="{media_src}" target="_blank" rel="lightbox">{image}</a>

However, I want it on the categories view that the lightbox opens if clicking on the thumbnail.
I tried the same trick with thumbnail_bit.html by wrapping the thumbnail in a href-tags and the rel="lightbox" tags but it won't work.

Any ideas how to get it work on the categories page?


Open Functions.php and find

1
2
3
4
5
6
if ($show_link) {
    if ($open_window) {
      $thumb = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""))."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".$thumb."</a>";
    }
    else {
      $thumb = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""))."\">".$thumb."</a>";

Replace with

1
2
3
4
5
6
  if ($show_link) {
    if ($open_window) {
      $thumb = "<a href=\"".$media_src."\" border=\"".$width_height." rel=\"lightbox\" title=\"".$image_name."\">".$thumb."</a>";
    }
    else {
      $thumb = "<a href=\"".$media_src."\" border=\"".$width_height." rel=\"lightbox\" title=\"".$image_name."\">".$thumb."</a>";


Find
1
$file_src = get_file_path($thumb_file_name, "thumb", $cat_id, 0, 1);

add below
1
$media_src = get_file_path($media_file_name, "media", $cat_id, 0, 1);


Title: Re: JavaScript + CSS = Nice Picture Display
Post by: santadirk on June 11, 2008, 01:07:44 PM
Hallo zusammen

kann einer noch einmal zusammenfassen in welchen Dateien man Änderungen durchführen muss?
Würde die Lightbox 2 gerne für meine Homepage nutzen aber irgendwie verstehe ich ausser Alessions letzten Beitrag ziemlich wenig

Danke


Title: Re: JavaScript + CSS = Nice Picture Display
Post by: mawenzi on June 11, 2008, 04:29:53 PM
... da gibt es eigentlich nicht viel zum Zusammenfassen ...
... die Einbauanleitung gibt es hier ... http://www.huddletogether.com/projects/lightbox2/#support


Title: Re: JavaScript + CSS = Nice Picture Display
Post by: santadirk on June 12, 2008, 09:46:27 AM
aber dort steht doch nirgends wo ich Änderungen in meiner 4images Gallery durchführen muss??

Dirk


Title: Re: JavaScript + CSS = Nice Picture Display
Post by: Alessio on June 16, 2008, 01:22:52 AM
Hallo zusammen

kann einer noch einmal zusammenfassen in welchen Dateien man Änderungen durchführen muss?
Würde die Lightbox 2 gerne für meine Homepage nutzen aber irgendwie verstehe ich ausser Alessions letzten Beitrag ziemlich wenig

Danke

You have to edit the functions.php file (read my previous message), then follow this instructions http://www.huddletogether.com/projects/lightbox2/ (http://www.huddletogether.com/projects/lightbox2/) (Part 1 only)


Title: Re: JavaScript + CSS = Nice Picture Display
Post by: Sin Nombre on June 26, 2008, 06:51:12 PM
i like the premise and i was thinking of implementing it on my website but
my site has 100% .swf flash games, no images. so a slideshow wouldn't be the greatest idea.

...i can imagine someone half way through pacman and another game loads dynamically...

so would there be a way to take off the play button?
and keep it stationary, so it wouldn't automatically load another "image" or in this case flash game?
and possibly add random thumbnails to other games in the same category underneath or along the side?


or am i asking for too much?


Title: Re: JavaScript + CSS = Nice Picture Display
Post by: GeO3x on July 07, 2008, 10:24:03 AM
Hi, how can I modify the {image} from details page?...
I want to use the lighbox2 to view the images and I need to put inside the image tag
rel="lightbox[{cat_id}]"

to all the images from that category...

Anyone?


Title: Re: JavaScript + CSS = Nice Picture Display
Post by: Alessio on July 28, 2008, 12:02:55 AM
There was an error in instructions of mine here http://www.4homepages.de/forum/index.php?topic=11115.msg95383#msg95383 (http://www.4homepages.de/forum/index.php?topic=11115.msg95383#msg95383) but now are ok.


Title: Re: JavaScript + CSS = Nice Picture Display
Post by: HorrorCrafT on October 15, 2008, 10:18:56 AM
mit der änderung die Alessio eine seite zuvor gepostet hat bekomm ich das ergbnis dass wenn ich auf ein thumbnail klicke, sich die lightbox öffnet. hab ich das richtig verstanden?
wie bekomm ich es jetzt noch hin dass unter jedem thumbnail noch ein link "Detailansicht" steht, damit ich um kommentar zu schreiben auch die möglichkeit habe in die detailansicht zu wechseln?

danke für tipps!


Title: Re: JavaScript + CSS = Nice Picture Display
Post by: mawenzi on October 15, 2008, 10:35:05 AM
... in deiner /templates/<dein_template>/thumbnail_bit.html verwende ...
1
Mehr: <a href="{image_url}">Details</a>


Title: Re: JavaScript + CSS = Nice Picture Display
Post by: HorrorCrafT on October 16, 2008, 12:36:58 AM
funktioniert bestens mawenzi! dankeschön! 8)

noch ein kleiner tipp falls es sonst noch jemand verwenden möchte: im code von Alessio einfach nach "lightbox" noch ein zusätzlicher wert in eckiger klammer mitgeben. dann muss nicht jedes bild einzeln angeklickt werden sondern es können alle auf dieser seite befindlichen bilder der reihe nach angeschaut werden. als beispiel also wie folgt:

1
2
3
4
5
6
if ($show_link) {
    if ($open_window) {
      $thumb = "<a href=\"".$media_src."\" border=\"".$width_height." rel=\"lightbox[4images rockt]\" title=\"".$image_name."\">".$thumb."</a>";
    }
    else {
      $thumb = "<a href=\"".$media_src."\" border=\"".$width_height." rel=\"lightbox[4images rockt]\" title=\"".$image_name."\">".$thumb."</a>";


Title: Re: JavaScript + CSS = Nice Picture Display
Post by: Vosey09 on December 14, 2009, 07:12:51 PM
hi there, gr8 mod.

i am wondering if there is a way to hide the link in the status bar, or make it look hidden in some way.


Title: Re: JavaScript + CSS = Nice Picture Display
Post by: michisa86888 on April 18, 2012, 06:57:29 PM
Hallo,
Ok das mit der functions.php geht klar.
Aber habe keine Ahnung wo ich die Lightbox Links einfügen soll

   

1
2
<script src="js/jquery-1.7.2.min.js"></script> <script src="js/lightbox.js"></script>

 
1
<link href="css/lightbox.css" rel="stylesheet" />
??

Und in welches Verzeichnis muss ich die Lightbox kopieren? Reicht es wenn ich einen Ordner im Hauptverzeichnis von 4images erstelle ihn Lightbox nenne und dort die dateien reinkopier??


Title: Re: JavaScript + CSS = Nice Picture Display
Post by: Rembrandt on April 18, 2012, 09:27:40 PM
Hi!

Erstelle 2 Ordner in deiner Galerie, "js" im Stammverzeichniss  und den "css" in deinen Template Ordner, die "jquery-1.7.2.min.js" und "lightbox.js" kopierst du in den "js" Ordner, und die "lightbox.css" kopierst du in den "css" Ordner.

suche in deiner templates/header.html:
1
{if has_rss}
und füge darüber ein:
1
2
3
<link href="css/lightbox.css" rel="stylesheet" />
<script src="./js/jquery-1.7.2.min.js"></script>
<script src="./js/lightbox.js"></script>

mfg Andi


Title: Re: JavaScript + CSS = Nice Picture Display
Post by: michisa86888 on April 30, 2012, 02:10:18 PM
Ok das mit der Lightbox öffnen funktioniert jetzt einwandfrei. Jetzt will ich nur noch das wenn ich das erste Bild einer Kategorie öffne in der Lightbox selber zwischen den Fotos hin und her klicken kann. (Eventuell links rechts "Pfleile Buttons")
Wie bekomme ich dass dann noch hin?
Ist vielleicht auch noch eine Diashow möglich?