File tree 2 files changed +13
-3
lines changed
2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 3
3
< head >
4
4
< meta charset ="UTF-8 ">
5
5
< title > jQuery Rellax Plugin Demo and Documentation</ title >
6
- < meta name ="viewport " content ="width=device-width, initial-scale=1 ">
6
+ < meta name ="viewport " content ="width=device-width, initial-scale=1, user-scalable=no ">
7
7
< script src ="//cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.js "> </ script >
8
8
< link rel ="stylesheet " href ="//fonts.googleapis.com/css?family=Roboto+Slab:700 ">
9
9
< link rel ="stylesheet " type ="text/css " href ="assets/css/prism.css ">
254
254
left : 50% ;
255
255
width : 1em ;
256
256
height : 1em ;
257
+ margin-top : -0.5em ;
258
+ margin-left : -0.5em ;
257
259
border : 0.5em solid black;
258
260
border-radius : 50% 50% 0 50% ;
259
261
transform : rotate (45deg );
Original file line number Diff line number Diff line change 48
48
$window . on ( 'load' , function ( ) {
49
49
reloadAll ( ) ;
50
50
prepareAll ( ) ;
51
- updateAll ( true ) ;
51
+ requestAnimationFrame ( function ( ) {
52
+ updateAll ( true ) ;
53
+ } ) ;
52
54
$ . each ( elements , function ( i , element ) {
53
55
element . $el . addClass ( 'rellax-active' ) ;
54
56
} ) ;
112
114
this . height = this . $el . outerHeight ( ) ;
113
115
this . width = this . $el . outerWidth ( ) ;
114
116
117
+ this . offset . top -= this . options . bleed ;
118
+ this . height += 2 * this . options . bleed ;
119
+
115
120
if ( this . parent !== undefined ) {
116
121
this . height = windowHeight - ( windowHeight - this . parent . height ) * ( 1 - this . options . amount ) ;
117
122
this . offset . top = ( this . parent . height - this . height ) / 2 ;
128
133
if ( this . parent == undefined ) {
129
134
this . $el . addClass ( 'rellax-element' ) ;
130
135
this . $el . css ( {
136
+ position : 'fixed' ,
137
+ left : this . offset . left ,
131
138
top : this . offset . top ,
139
+ width : this . width ,
132
140
height : this . height
133
141
} ) ;
134
142
} else {
195
203
$ . fn . rellax . defaults = {
196
204
amount : 0.5 ,
197
205
bleed : 0 ,
198
- scale : 1.2 ,
206
+ scale : 1 ,
199
207
container : '[data-rellax-container]'
200
208
} ;
201
209
You can’t perform that action at this time.
0 commit comments