{
$res = parent::getCSS();
$this->copyExternalFile($this->to);
- $res .= 'background-image:url(' . $this->getImageUrl() . ');background-size:' . $this->getBackgroundSize() . ';background-position:' . $this->getBackgroundPosition() . ';background-repeat:no-repeat;';
return $res;
}
- public function getBackgroundPosition()
- {
- $animations = self::parseAnimations($this->image_rollover);
- foreach ($animations as $animation) {
- if (($animation['type'] === 'zoomout' || $animation['type'] === 'zoomin') && isset($animation['transformorigin'])) {
- return $animation['transformorigin'];
- }
- }
- return '50% 50%';
- }
-
- public function getBackgroundSize()
- {
-
- $size = '100%';
- $animations = self::parseAnimations($this->image_rollover);
- foreach ($animations as $animation) {
- if ($animation['type'] === 'zoomout') {
- $size = round($animation['scale'] * 100) . '%';
- }
- }
- return $size . ' ' . $size;
- }
-
public function getAdditionnalContent()
{
$res = parent::getAdditionnalContent();
return $res;
}
+ public function getHTMLContent()
+ {
+ if (stristr($this->rollover, 'type=zoom')) {
+ return '<div class="img" style="background-image:url(' . $this->getImageUrl() . ');"></div>';
+ } else {
+ return '<img src="' . $this->getImageUrl() . '" />';
+ }
+ }
+
}