How to implement the ThickBox(http://jquery.com/demo/thickbox/) within a project that powered by Yii?
Page 1 of 1
ThickBox Implementation
#2
Posted 17 February 2009 - 06:26 AM
Quote
How to implement the ThickBox(http://jquery.com/demo/thickbox/) within a project that powered by Yii?
Hello Ramin,
I think the smartest way, would be to build an extension, which wrap the functionallity of the thickbox script.
In this case, the required Steps are:
1. publish and register the clientside files like .css and .js
2. build and output the required markup (html)
I attached an unfinished version, how this could look like.
At the moment it features the "single image" and "image gallery" mode.
I leave it to you to implement the 3 remaining modes ('inline', 'iframed' and 'ajax').
Download it here.
Unpack it to the "protected/extensions" folder of your yii project.
For a single image use:
<?php
$this->widget('application.extensions.thickbox.EThickbox',
array(
'mode'=>'image',
'data'=>array('images/yii-powered.png', 'images/logo.gif', 'Yii rocks...')
)
);
?>
or for a gallery:
<?php
$this->widget('application.extensions.thickbox.EThickbox',
array(
'mode'=>'gallery',
'data'=>array(
array('images/plant1_t.jpg', 'images/plant1.jpg', 'description text...'),
array('images/plant2_t.jpg', 'images/plant2.jpg', 'another description text...')
)
)
);
?>
And remeber, this should just be an example for you, how to build an extension and not a complete wrap up for the thickbox script.
Ahh and it seems that thickbox has some troubles with jquery 1.3.0 which comes with yii 1.0.2.
greets ironic
Attached File(s)
-
thickbox.zip (21.92K)
Number of downloads: 10
#4
Posted 22 April 2009 - 05:49 AM
Thanks, it worked for me .
The issue with jQuery 1.3.0 is that the gallery mode won't work.
It's fixed by changing thickbox.js line 79 from
to
The issue with jQuery 1.3.0 is that the gallery mode won't work.
It's fixed by changing thickbox.js line 79 from
to
#5
Posted 26 June 2012 - 09:56 AM
i can't download for "thickbox.zip (21.92K)"
error: [#10173] We could not find the attachment you were attempting to view.
error: [#10173] We could not find the attachment you were attempting to view.
Share this topic:
Page 1 of 1

Help

This topic is locked











