Ignore:
Timestamp:
10/12/12 16:38:48 (12 years ago)
Author:
vmipsl
Message:

slides

Location:
ether_statistics/web/resources
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • ether_statistics/web/resources/css/statistics.css

    r592 r593  
    108108} 
    109109 
     110#title { 
     111    position: relative; 
     112    top: 17px; 
     113    left: 3px; 
     114} 
     115 
    110116#home, #mail, #login { 
    111117    padding: 15px 0 0 23px; 
     
    116122    padding: 21px 0 0 28px; 
    117123    width: 62px; 
     124    position: relative; 
     125    top: 23px; 
     126    left: 17px; 
     127} 
     128 
     129#mail { 
     130    position: relative; 
     131    top: -15px; 
     132    left: 20px; 
    118133} 
    119134 
    120135#copy { 
    121136    position: absolute; 
    122     top: 492px; 
    123     left: 800px; 
     137    top: 500px; 
     138    left: 773px; 
    124139} 
    125140 
     
    140155    float: left; 
    141156    margin-right: 10px; 
     157    top: 41px; 
     158    left: 4px; 
    142159} 
    143160 
     
    146163    top: 0; 
    147164    left: 0; 
    148     z-index: 1; 
    149165} 
    150166 
     
    153169    top: 21px; 
    154170    left: 25px; 
    155     z-index: 2; 
    156171} 
    157172 
     
    159174    visibility: hidden; 
    160175    position: absolute; 
    161     z-index: 2; 
    162176} 
    163177 
  • ether_statistics/web/resources/js/classesForJQuery/DragSlide.js

    r570 r593  
    11//************************************************************************* 
    2 // Class Slide 
    3 // Display a Slide 
     2// Class DragSlide 
     3// Display a draggable slide 
    44// 
    55// use jQuery 
     
    88//************************************************************************* 
    99 
    10 var Slide = Class.create( { 
     10var DragSlide = Class.create( { 
    1111 
    1212    initialize: function( objectParameter ) 
     
    1414        // Param 
    1515        this.parent = objectParameter.parent ? objectParameter.parent : document.body; 
     16        this.titleId = objectParameter.titleId; 
    1617        this.contentId = objectParameter.contentId; 
    17         this.buttonId = objectParameter.buttonId; 
     18        this.width = objectParameter.width; 
     19        this.height = objectParameter.height; 
     20        this.top = objectParameter.top; 
     21        this.left = objectParameter.left; 
     22        this.specificClass = objectParameter.specificClass; 
     23        this.specificTitleClass = objectParameter.specificTitleClass ? objectParameter.specificTitleClass : false; 
    1824        this.specificContentClass = objectParameter.specificContentClass ? objectParameter.specificContentClass : false; 
    19         this.specificButtonClass = objectParameter.specificButtonClass ? objectParameter.specificButtonClass : false; 
    20         this.timeToSlide = objectParameter.timeToSlide ? objectParameter.timeToSlide : 1000; 
     25        this.title = objectParameter.title; 
    2126        this.contentSlide = objectParameter.contentSlide ? objectParameter.contentSlide : false; 
    2227        this.contentPageSlide = objectParameter.contentPageSlide ? objectParameter.contentPageSlide : false; 
    23         this.contentButton = objectParameter.contentButton; 
    2428        this.isIndexToChange = objectParameter.isIndexToChange ? objectParameter.isIndexToChange : false; 
    25         this.zIndex = this.parent.css( "z-index" ); 
    2629 
    27         // Content div 
    28         this.divSlideContent = $( document.createElement( "div" ) ); 
    29         this.divSlideContent.attr( {id:this.contentId, class:"containerSlideContent"} ); 
     30        this.divContainer = $( document.createElement( "div" ) ); 
     31        if( this.specificClass ) 
     32            this.divContainer.addClass( this.specificClass ); 
     33        this.divContainer.attr( {id:this.id, style:"width:" + this.width + "px; height:" + this.height + "px; top:" + this.top + "; left:" + this.left} ); 
     34 
     35        // Title 
     36        this.divTitle = $( document.createElement( "div" ) ); 
     37        if( this.specificTitleClass ) 
     38            this.divTitle.addClass( this.specificTitleClass ); 
     39        this.divTitle.html( this.title ); 
     40        this.divTitle.attr( {style:"width:" + (this.width - 7) + "px"} ); 
     41        this.divContainer.append( this.divTitle ); 
     42 
     43        // Content 
     44        this.divContent = $( document.createElement( "div" ) ); 
    3045        if( this.specificContentClass ) 
    31             this.divSlideContent.addClass( this.specificContentClass ); 
    32         if( this.contentId ) 
    33             this.divSlideContent.html( this.contentSlide ); 
    34         this.parent.append( this.divSlideContent ); 
     46            this.divContent.addClass( this.specificContentClass ); 
     47        this.divContent.html( this.content ); 
     48        this.divContainer.append( this.divContent ); 
    3549 
    36         // Button div 
    37         this.divSlideButton = $( document.createElement( "div" ) ); 
    38         this.divSlideButton.attr( {id:this.buttonId} ); 
    39         this.divSlideButton.attr( {id:this.buttonId, class:"containerSlideButton"} ); 
    40         if( this.specificButtonClass ) 
    41             this.divSlideButton.addClass( this.specificButtonClass ); 
    42         this.divSlideButton.append( this.contentButton ); 
    43         this.divSlideButton.bind( "click", jQuery.proxy( this.onClickButton, this ) ); 
    44         this.parent.append( this.divSlideButton ); 
     50        this.parent.append( this.divContainer ); 
     51 
     52        this.divContainer.draggable(); 
     53        this.divContainer.resizable(); 
     54//        this.divContainer.dblclick(); 
     55        this.divTitle.dblclick( jQuery.proxy( this.onDbClickTitle, this ) ); 
     56        this.divContainer.resize( jQuery.proxy( this.onResizeContainer, this ) ); 
    4557    }, 
    4658 
    4759    getContent: function() 
    4860    { 
    49         return this.divSlideContent.html(); 
     61        return this.divContent.html(); 
    5062    }, 
    5163 
    5264    setContent: function( newContent ) 
    5365    { 
    54         this.divSlideContent.html( newContent ); 
     66        this.divContent.html( newContent ); 
    5567    }, 
    5668 
    5769    isContentVisible: function() 
    5870    { 
    59         return (this.divSlideContent.css( "display" ) == "block"); 
     71        return (this.divContent.css( "display" ) == "block"); 
    6072    }, 
    6173 
    6274    // public 
    63     onClickButton: function() 
     75    onDbClickTitle: function() 
    6476    { 
    65         if( this.isIndexToChange && !this.isContentVisible() ) 
    66             this.parent.css( "z-index", 100 ); 
     77        if( this.width == this.divContainer.width() ) 
     78            this.enlargeContainer(); 
     79        else 
     80            this.reduceContainer(); 
     81    }, 
    6782 
    68         this.divSlideContent.animate( {width:"toggle"}, this.timeToSlide, jQuery.proxy( function() 
     83    enlargeContainer: function() 
     84    { 
     85        this.divContainer.animate( { 
     86            height:'500px', 
     87            width:'500px' 
     88        }, 1000, function() 
    6989        { 
    70             if( this.isIndexToChange && !this.isContentVisible() ) 
    71                 this.parent.css( "z-index", this.zIndex ); 
    72         }, this ) ); 
     90        } ); 
     91        this.divTitle.animate( { 
     92            width:'493px' 
     93        }, 1000, function() 
     94        { 
     95        } ); 
     96    }, 
    7397 
    74         if( this.contentPageSlide ) 
    75             this.divSlideContent.load( this.contentPageSlide ); 
     98    reduceContainer: function() 
     99    { 
     100        this.divContainer.animate( { 
     101            height:this.height + 'px', 
     102            width:this.width + 'px' 
     103        }, 1000, function() 
     104        { 
     105        } ); 
     106        this.divTitle.animate( { 
     107            width:(this.width - 7) + 'px' 
     108        }, 1000, function() 
     109        { 
     110        } ); 
     111    }, 
     112 
     113    onResizeContainer: function() 
     114    { 
     115        var widthTitle = this.divContainer.width() - 7; 
     116        this.divTitle.width( widthTitle ); 
    76117    } 
    77118} ); 
Note: See TracChangeset for help on using the changeset viewer.