webForumDet fria alternativet

Modda ThickBox till att funka med <select>

2 svar · 495 visningar · startad av oskars

oskarsMedlem sedan nov. 20051 317 inlägg
#1

Tjabba!

Jag har fått igång ThickBox på en site, och det scriptet är ju väldigt snyggt faktiskt.

Men jag behöver modda det så det funkar för min tänkta funktion.

För tillfället så kallar jag på scriptet så här:

<a href="minbild.jpg" title="Bildtext" class="thickbox"><img src="minbild_stor.jpg" alt="Single Image"/></a>

Jag funderar på om man skulle kunna göra om det på något enkelt sätt så man kan köra följande:

<select>
   <option>Välj bild:</option>
   <option value="minbild.jpg">Min bild</option>
</select>

Är det här ett stort ingrepp, eller är det lätt fixat måntro?

Hoppas ni hajjar vad jag är ute efter :)

Mvh
Oskar

voigtann1Medlem sedan juni 20019 519 inlägg
#2

http://jquery.com/demo/thickbox/
kolla deras demo så får du nog det du vill ha ;)

(snabb läsning) skapar en html fil med din <select> och länkar den bara.
eller:

http://jquery.com/demo/thickbox/#sectiond-1 skrev:

* Create a link element (<a href>)
* Give the link a class attribute with a value of thickbox (class="thickbox")
* In the href attribute of the link add the following anchor: #TB_inline
* In the href attribute after the #TB_inline add the following query string on to the anchor:

  ?height=300&width=300&inlineId=myOnPageContent

\* Change the values of height, width, and inlineId in the query accordingly (inlineID is the ID value of the element that contains the content you would like to show in a ThickBox.
\* Optionally you may add modal=true to the query string (e.g. #TB_inline?height=155&width=300&inlineId=hiddenModalContent&modal=true) so that closing a ThickBox will require calling the tb_remove() function from within the ThickBox. See the hidden modal content example, where you must click yes or no to close the ThickBox.
oskarsMedlem sedan nov. 20051 317 inlägg
#3

Jo jo... men den där fixar ju bara fram en div... jag vill ha bilder :) Förstår att man kan ju lägga bilderna i den gömda divven men det är ju en lite dum lösning.

skulle vilja ha istället för "inlineID=" typ "inelineUrl" eller nått!

125 ms totalt · 3 externa anrop · v20260731065814-full.30151723
0 ms — hämta forumlista (cache)
0 ms — hämta statistik (cache)
123 ms — hämta tråd, inlägg och bilagor (db)