]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
changed the div background to img element - #368
authorMinoo <minoo.ziaei@gmail.com>
Fri, 1 Apr 2011 18:06:07 +0000 (14:06 -0400)
committerMinoo <minoo.ziaei@gmail.com>
Fri, 1 Apr 2011 18:06:07 +0000 (14:06 -0400)
plugins/image/popcorn.image.html
plugins/image/popcorn.image.js

index b3059d3221dba801036453f470e23ecfa4d7fb78..4003d3206717351980cf0f1f4c7879d3c4781a11 100644 (file)
@@ -53,9 +53,8 @@
 
     </video> 
   </div>
-  <div style="width:400px; height:400px">
-    <div id="imagediv"></div>
-  </div>  
+  <div style="width:400px; height:400px" id="imagediv">
+  </div> 
 
 </body>
 </html>
index 371d9dc6b60fc33a881e0a6826a901979626e84f..3a2bfff6f2541b5a34e03c5a2d2390bcba433447 100644 (file)
@@ -47,8 +47,7 @@
       },
 
       _setup: function( options ) {
-        var s, st; 
-        
+
         options.link = document.createElement( 'a' );
         options.link.style.display = "none"; // display none by default
         if ( options.href ) {
         if ( document.getElementById( options.target ) ) {
           document.getElementById( options.target ).appendChild( options.link ); // add the widget's div to the target div
         }
-        var div = document.createElement( 'div' );
-        divStyle = {
-          width : '100%',
-          height : '600px',
-          background : "url( " + options.src + " ) no-repeat ",
-          backgroundSize : '100%',
-          MozBackgroundSize: '100%',
-          borderStyle : 'none'
-        };
-        for ( s in divStyle ) {
-          div.style[ s ] = divStyle[ s ];
-        }
         
-        var divText = document.createElement( 'div' ); // add the inner div for overlaying text
+
+
+        
+        var img = document.createElement( 'img' );
+        img.src = options.src;
+        img.style
+        img.style.borderStyle = "none"; // borders look really bad, if someone wants it they can put it on their div target
+        
+        var divText = document.createElement( 'div' );
         divTextStyle = {
-          width : '50%',
-          margin : 'auto',
-          marginTop : '20px',
-          color : 'black',
-          fontWeight : 'bold',
-          textAlign : 'center'
+            margin: 'auto',
+            position: 'absolute',
+            overflow: 'hidden',
+            paddingTop: '20px',
+            paddingLeft: '20px',
+            paddingBottom: '0',
+            fontSize: 'large',
+            color: 'black',
+            fontWeight : 'bold',
+            zIndex: '10',
         };
         for ( st in divTextStyle ) {
           divText.style[ st ] = divTextStyle[ st ];
         }
         divText.innerHTML = options.text;
         
-        div.appendChild( divText ); 
-        options.link.appendChild( div );
-        
+        options.link.appendChild( divText );
+        options.link.appendChild( img );
       },
 
       /**