]> source.dussan.org Git - jquery-ui.git/commitdiff
demo: #3185
authorChi Cheng <cloudream@gmail.com>
Sat, 16 Aug 2008 14:37:44 +0000 (14:37 +0000)
committerChi Cheng <cloudream@gmail.com>
Sat, 16 Aug 2008 14:37:44 +0000 (14:37 +0000)
demos/real-world/photo-manager/img/slider-bg-2.png [new file with mode: 0644]
demos/real-world/photo-manager/img/slider-handle.gif [new file with mode: 0644]
demos/real-world/photo-manager/index.html
demos/real-world/photo-manager/js/demo.js
demos/real-world/photo-manager/theme/css/screen.css

diff --git a/demos/real-world/photo-manager/img/slider-bg-2.png b/demos/real-world/photo-manager/img/slider-bg-2.png
new file mode 100644 (file)
index 0000000..8b24cf0
Binary files /dev/null and b/demos/real-world/photo-manager/img/slider-bg-2.png differ
diff --git a/demos/real-world/photo-manager/img/slider-handle.gif b/demos/real-world/photo-manager/img/slider-handle.gif
new file mode 100644 (file)
index 0000000..9b89f26
Binary files /dev/null and b/demos/real-world/photo-manager/img/slider-handle.gif differ
index de2fc0893674c8d84755d344420a2d70ec97a686..889f0fce0f82e04b037770113ce10ad677db31aa 100644 (file)
                <script type="text/javascript" src="../../../ui/ui.core.js"></script>
                <script type="text/javascript" src="../../../ui/ui.draggable.js"></script>
                <script type="text/javascript" src="../../../ui/ui.droppable.js"></script>
+               <script type="text/javascript" src="../../../ui/ui.slider.js"></script>
 
                <script type="text/javascript" src="./js/demo.js"></script>
+               <style type="text/css" media="all">
+                       .ui-slider { width: 200px; height: 23px; position: relative; background-repeat: no-repeat; background-position: center center; }
+                       .ui-slider-handle { position: absolute; z-index: 1; height: 23px; width: 12px; top: 0px; left: 0px; background-image: url(img/slider-handle.gif); }
+                       .ui-slider-handle-active { border: 1px dotted black; }
+                       .ui-slider-disabled .ui-slider-handle { opacity: 0.5; filter: alpha(opacity=50); }
+                       .ui-slider-range { position: absolute; background: #50A029; opacity: 0.3; filter: alpha(opacity=30); width: 100%; height: 100%; }
 
+                       .ui-slider, .ui-slider-1 { background-image: url(img/slider-bg-1.png); }
+                       .ui-slider-2 { background-image: url(img/slider-bg-2.png); clear:both}
+                       .nominheight{min-height:20px;}
+               </style>
                <link rel="stylesheet" type="text/css" href="./theme/css/screen.css" media="screen, projection" />
        </head>
        <body>
                                </ul>
                        </div>
                        <div id="sidebar">
+                               <div class="box2" id="resize">
+                                       <h2>Resize images</h2>
+                                       <div style="margin: 5px; padding: 5px;min-height:20px" class="ui-slider-2 ui-slider" id="sliderSize">
+                                               <a style="cursor: default;" href="javascript:void(0)">
+                                                       <div class="ui-slider-handle" style="left: 150px;min-height:20px"></div>
+                                               </a>    
+                                       </div>  
+                               </div>
                                <div class="box" id="trash">
                                        <h2>Trash (drag me back)</h2>
                                        <div></div>
index fac91ca1c908d9650ba94e3a5228a030ecad9379..9abc039bbfbe7119827dfde95beb8c54526d4c90 100644 (file)
@@ -117,6 +117,26 @@ $(window).bind('load', function() {
                        .displayBox();
                return false;
        });
+       
+       
+       var sliderChange = function(e, ui){
+               $('.img_content').each(function(index, item){
+                       var _new = 1.44 * $('#sliderSize').slider("value");
+                       
+                       $(this).css("width", _new+'px')
+                               .parent().css("width", (_new+16)+'px');
+                       
+               });
+       }
+       $('#sliderSize').slider({
+               startValue : 100,
+               min : 50,
+               max : 100,
+               stepping : 5,
+               slide : sliderChange,
+               change : sliderChange
+       });
+       
 });
 
 function createGalleryItem(img) {
index 3866beb8e406a7119ba8358723f99a2246878824..3a51f70e12d8f7b36ec0e4968e34bd30ce539e7e 100644 (file)
@@ -116,12 +116,12 @@ h1 {
 ----------------
 =SIDEBAR
 ---------------- */
-.box {
+.box, .box2 {
        margin: 18px;
        border: 1px solid #ccc;
        background: #fff;
 }
-.box h2 {
+.box h2, .box2 h2 {
        padding: 0 8px;
        margin: 0;
        font-size: 1.5em;