Subversion Repositories SmartDukaan

Rev

Rev 11724 | Rev 11732 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 11724 Rev 11731
Line 36... Line 36...
36
  		<?php 
36
  		<?php 
37
			$userAgent = $_SERVER['HTTP_USER_AGENT'];
37
			$userAgent = $_SERVER['HTTP_USER_AGENT'];
38
			if (strripos($userAgent,'Opera') == 0) {?>
38
			if (strripos($userAgent,'Opera') == 0) {?>
39
				<script  data-pace-options='{ "startOnPageLoad": false }' src='<?=base_url()?>assets/js/pace.js' type="text/javascript"></script>
39
				<script  data-pace-options='{ "startOnPageLoad": false }' src='<?=base_url()?>assets/js/pace.js' type="text/javascript"></script>
40
		<?php } ?>
40
		<?php } ?>
-
 
41
<!--Start product detail js-->
-
 
42
<?php if(isset($route) && $route == 'productinfo'){?>
-
 
43
<script type="text/javascript">             
-
 
44
  var isOperaMini = (navigator.userAgent.indexOf('Opera Mini') > -1);
41
 
45
 
-
 
46
    if(isOperaMini ){
-
 
47
     document.getElementById('view-more').style.display = 'block';
-
 
48
     document.getElementById('viewmore_1').style.display = 'block';
-
 
49
    }
-
 
50
    var len = document.getElementById('swipe_0').children[0].children.length;
-
 
51
    var len1 = document.getElementById('swipe_1').children[0].children.length;
-
 
52
  	var count = 1
-
 
53
  	function showAll(){
-
 
54
    
-
 
55
   	if(count == 1){
-
 
56
    	document.getElementById('view-more').innerHTML = 'Close';
-
 
57
    	document.getElementById('swipe_0').children[0].style.whiteSpace = 'inherit';
-
 
58
    	document.getElementById('swipe_0').children[0].style.display = 'block';
-
 
59
    	for(var i =0; i< len;i++){
-
 
60
     		document.getElementsByClassName('pd-image')[i].style.width = '100%';
-
 
61
    	}
-
 
62
    	count = 2; 
-
 
63
   	}else{
-
 
64
     	document.getElementById('view-more').innerHTML = 'View All';
-
 
65
     	document.getElementById('swipe_0').children[0].style.whiteSpace = 'nowrap';
-
 
66
    	document.getElementById('swipe_0').children[0].style.display = 'inline-block';
-
 
67
    	for(var i =0; i< len;i++){
-
 
68
     	document.getElementsByClassName('pd-image')[i].style.width = '';
-
 
69
    	}
-
 
70
    	count = 1;
-
 
71
   	} 
-
 
72
  }
-
 
73
  
-
 
74
  var count1 = 1
-
 
75
    function showAll1(){
-
 
76
      if(count1 ==1){
-
 
77
        document.getElementById('viewmore_1').innerHTML = 'Close';
-
 
78
        document.getElementById('swipe_1').children[0].style.whiteSpace = 'inherit';
-
 
79
        document.getElementById('swipe_1').children[0].style.display = 'block';
-
 
80
        for(var i =0; i< len1;i++){
-
 
81
         document.getElementsByClassName('rec-product')[i].style.width = '50%';
-
 
82
          if(i%2 == 0){
-
 
83
            document.getElementsByClassName('rec-product')[i].style.cssFloat = 'left';  
-
 
84
           }else{
-
 
85
            document.getElementsByClassName('rec-product')[i].style.cssFloat = 'right';
-
 
86
            document.getElementsByClassName('rec-product')[i].style.border = 'none';
-
 
87
          }
-
 
88
        }
-
 
89
        count1 = 2;    
-
 
90
      }else{
-
 
91
        document.getElementById('viewmore_1').innerHTML = 'View More';
-
 
92
        document.getElementById('swipe_1').children[0].style.whiteSpace = 'nowrap';
-
 
93
        document.getElementById('swipe_1').children[0].style.display = 'inline-block';
-
 
94
        for(var i =0; i< len1;i++){
-
 
95
         document.getElementsByClassName('rec-product')[i].style.width = '';
-
 
96
          if(i%2 == 0){
-
 
97
            document.getElementsByClassName('rec-product')[i].style.cssFloat = '';  
-
 
98
           }else{
-
 
99
            document.getElementsByClassName('rec-product')[i].style.cssFloat = '';
-
 
100
            document.getElementsByClassName('rec-product')[i].style.border = '';
-
 
101
          }
-
 
102
        }
-
 
103
        count1 = 1;
-
 
104
      }
-
 
105
    
-
 
106
  }  
-
 
107
  var isIE10 = false;
-
 
108
 
-
 
109
  /*@cc_on
-
 
110
 
-
 
111
   if (/^10/.test(@_jscript_version)) {
-
 
112
 
-
 
113
   isIE10 = true;
-
 
114
 
-
 
115
   }
-
 
116
 
-
 
117
   @*/
-
 
118
 
-
 
119
  var iOS = navigator.userAgent.match(/(iPad|iPhone|iPod)/g);
-
 
120
 
-
 
121
  var ua = navigator.userAgent;
-
 
122
 
-
 
123
  var userAgent = navigator.userAgent.toLowerCase();
-
 
124
 
-
 
125
  if (isIE10) {
-
 
126
       var a = document.getElementsByClassName('rec-hldr');
-
 
127
      
-
 
128
          for (var i = 0; i < a.length; i++) {
-
 
129
      
-
 
130
            a[i].style.overflowX = 'auto';
-
 
131
      
-
 
132
          }
-
 
133
      
-
 
134
        }
-
 
135
        
-
 
136
        else if (ua.indexOf("Android") >= 0) {
-
 
137
 
-
 
138
          var androidversion = parseFloat(ua.slice(ua.indexOf("Android") + 8));
-
 
139
        
-
 
140
         if (androidversion < 3.0) {
-
 
141
 
-
 
142
       var script = document.createElement("script");
-
 
143
 
-
 
144
      script.type = "text/javascript";
-
 
145
 
-
 
146
      script.src = base_url+'assets/js/iscroll.js'
-
 
147
 
-
 
148
      document.body.appendChild(script);
-
 
149
 
-
 
150
      script.onload = function() {
-
 
151
 
-
 
152
        var point, pointStartX, pointStartY, deltaX, deltaY;
-
 
153
 
-
 
154
        var i, scroller = [], len = document.getElementsByClassName('rec-hldr').length;
-
 
155
 
-
 
156
        var scrollerArray = document.getElementsByClassName('rec-hldr');
-
 
157
 
-
 
158
           for ( i = 0; i < scrollerArray.length; i++) {     
-
 
159
 
-
 
160
          var length = scrollerArray[i].children.length;
-
 
161
 
-
 
162
          scroller[i] = new iScroll("swipe_"+ i, {
-
 
163
 
-
 
164
            bounce : true,
-
 
165
 
-
 
166
            momentum : true,
-
 
167
 
-
 
168
            //hScroll: true,
-
 
169
 
-
 
170
            vScroll : false,
-
 
171
 
-
 
172
            hScrollbar : false,
-
 
173
 
-
 
174
            vScrollbar : false,
-
 
175
 
-
 
176
            snap : true,
-
 
177
 
-
 
178
            onBeforeScrollStart : function(e) {
-
 
179
 
-
 
180
              console.log("onBeforeScrollStart");
-
 
181
 
-
 
182
              point = e.touches[0];
-
 
183
 
-
 
184
              pointStartX = point.pageX;
-
 
185
 
-
 
186
              pointStartY = point.pageY; null;
-
 
187
 
-
 
188
            },
-
 
189
 
-
 
190
            onBeforeScrollMove : function(e) {
-
 
191
 
-
 
192
              console.log(e);
-
 
193
 
-
 
194
              point = e.touches[0];
-
 
195
 
-
 
196
              //alert("onBeforeScrollMove");
-
 
197
 
-
 
198
              deltaX = Math.abs(point.pageX - pointStartX);
-
 
199
 
-
 
200
              deltaY = Math.abs(point.pageY - pointStartY);
-
 
201
 
-
 
202
              if (deltaX >= deltaY) {
-
 
203
                e.preventDefault();
-
 
204
 
-
 
205
                // alert("horizontal");
-
 
206
 
-
 
207
              } else {
-
 
208
 
-
 
209
                //alert("vertical");
-
 
210
 
-
 
211
                null;
-
 
212
 
-
 
213
              }
-
 
214
 
-
 
215
            }
-
 
216
          });
-
 
217
        setTimeout(function() {
-
 
218
 
-
 
219
          for ( i = 0; i < len; i++) {
-
 
220
 
-
 
221
            scroller[i].refresh();
-
 
222
 
-
 
223
          }
-
 
224
 
-
 
225
        }, 100);
-
 
226
        }
-
 
227
 
-
 
228
      }
-
 
229
       }else {
-
 
230
 
-
 
231
      var a = document.getElementsByClassName('rec-hldr');
-
 
232
 
-
 
233
       for (var i = 0; i < a.length; i++) {
-
 
234
 
-
 
235
        a[i].style.overflowX = 'auto';
-
 
236
 
-
 
237
        a[i].style.webkitOverflowScrolling = 'touch';
-
 
238
 
-
 
239
      }
-
 
240
 
-
 
241
    }
-
 
242
    
-
 
243
    }else if (iOS) {
-
 
244
 
-
 
245
    if (navigator.userAgent.match(/(iPad|iPhone|iPod|iPod touch);.*CPU.*OS (6|7)_\d/i) ? true : false) {
-
 
246
    
-
 
247
     var a = document.getElementsByClassName('rec-hldr');
-
 
248
      for (var i = 0; i < a.length; i++) {
-
 
249
        a[i].style.overflowX = 'auto';
-
 
250
        a[i].style.overflowY = 'hidden';
-
 
251
        a[i].style.webkitOverflowScrolling = 'touch';
-
 
252
      }
-
 
253
 
-
 
254
    }else{
-
 
255
       var script = document.createElement("script");
-
 
256
      script.type = "text/javascript";
-
 
257
      script.src = base_url+'assets/js/iscroll.js'
-
 
258
      document.body.appendChild(script);
-
 
259
      script.onload = function() {
-
 
260
        var point, pointStartX, pointStartY, deltaX, deltaY;
-
 
261
        var i, scroller = [], len = document.getElementsByClassName('rec-wrapper').length;
-
 
262
        var scrollerArray = document.getElementsByClassName('rec-wrapper');
-
 
263
          //var length = scrollerArray[i].children.length;
-
 
264
          scroller[i] = new iScroll(swipe_1, {
-
 
265
            bounce : true,
-
 
266
            momentum : true,
-
 
267
            //hScroll: true,
-
 
268
            vScroll : false,
-
 
269
            hScrollbar : false,
-
 
270
            vScrollbar : false,
-
 
271
            snap : true,
-
 
272
            onBeforeScrollStart : function(e) {
-
 
273
              console.log("onBeforeScrollStart");
-
 
274
              point = e.touches;
-
 
275
              pointStartX = point.pageX;
-
 
276
              pointStartY = point.pageY; null;
-
 
277
            },
-
 
278
            onBeforeScrollMove : function(e) {
-
 
279
              console.log(e);
-
 
280
              point = e.touches;
-
 
281
              //alert("onBeforeScrollMove");
-
 
282
              deltaX = Math.abs(point.pageX - pointStartX);
-
 
283
              deltaY = Math.abs(point.pageY - pointStartY);
-
 
284
              if (deltaX >= deltaY) {
-
 
285
                e.preventDefault();
-
 
286
                // alert("horizontal");
-
 
287
              } else {
-
 
288
                //alert("vertical");
-
 
289
                null;
-
 
290
              }
-
 
291
            }
-
 
292
          });
-
 
293
    }
-
 
294
    }
-
 
295
    }else if (ua.indexOf("BlackBerry") >= 0 || ua.indexOf("BB10") >= 0) {
-
 
296
    var a = document.getElementsByClassName('rec-hldr');
-
 
297
    for (var i = 0; i < a.length; i++) {
-
 
298
      a[i].style.overflowX = 'auto';
-
 
299
      a[i].style.webkitOverflowScrolling = 'touch';
-
 
300
    }
-
 
301
  }
-
 
302
</script>
-
 
303
<?php } ?>
-
 
304
<!--End product detail js-->
42
<!-- Start Alexa Certify Javascript -->
305
<!-- Start Alexa Certify Javascript -->
43
<script type="text/javascript">
306
<script type="text/javascript">
44
_atrk_opts = { atrk_acct:"N82Fj1agtu00gJ", domain:"saholic.com",dynamic: true};
307
_atrk_opts = { atrk_acct:"N82Fj1agtu00gJ", domain:"saholic.com",dynamic: true};
45
(function() { var as = document.createElement('script'); as.type = 'text/javascript'; as.async = true; as.src = "https://d31qbv1cthcecs.cloudfront.net/atrk.js"; var s = document.getElementsByTagName('script')[0];s.parentNode.insertBefore(as, s); })();
308
(function() { var as = document.createElement('script'); as.type = 'text/javascript'; as.async = true; as.src = "https://d31qbv1cthcecs.cloudfront.net/atrk.js"; var s = document.getElementsByTagName('script')[0];s.parentNode.insertBefore(as, s); })();
46
</script>
309
</script>