RishiShreshtha

Untitled

Mar 18th, 2013
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 3.84 KB | None | 0 0
  1. /* All onReady Event */
  2. jQuery(document).ready(function () {
  3.  
  4. /* Add/Clear Search Text Field onClick/onBlur */
  5.   jQuery('input#s').val('Search');
  6.   jQuery('input#s').each(function () {
  7.     var form_text = this.value;
  8.     jQuery(this).focus(function () {
  9.       jQuery(this).css('color', '#222');
  10.       if (this.value == form_text) {
  11.         this.value = '';
  12.       }
  13.     });
  14.     jQuery(this).blur(function () {
  15.       jQuery(this).css('color', '#999');
  16.       if (this.value == '') {
  17.         this.value = form_text;
  18.       }
  19.     });
  20.   });
  21. });
  22.  
  23. /* All onLoad Event */
  24. jQuery(window).load(function () {
  25.  
  26. /* Flexslider (init) */
  27.   jQuery('.flexslider').flexslider({
  28.     slideshow: false,
  29.     animation: "fade",
  30.     direction: "horizontal",
  31.     controlNav: "thumbnails",
  32.     slideshowSpeed: 7000,
  33.     animationSpeed: 600
  34.   });
  35.  
  36.   /* Flexslider Bounce Effect */
  37.   jQuery(".flex-control-nav li").hover(function () {
  38.     var e = this;
  39.     jQuery(e).stop().animate({
  40.       marginTop: "-14px"
  41.     }, 250, function () {
  42.       jQuery(e).animate({
  43.         marginTop: "-10px"
  44.       }, 250);
  45.     });
  46.   }, function () {
  47.     var e = this;
  48.     jQuery(e).stop().animate({
  49.       marginTop: "4px"
  50.     }, 250, function () {
  51.       jQuery(e).find(".flex-control-nav li").animate({
  52.         marginTop: "0px"
  53.       }, 250);
  54.     });
  55.   });
  56.  
  57.   /* Flexslider Wrapping Of Text Inside Main Caption "p" Tag */
  58.   var flex = jQuery('p.flex-caption');
  59.   var text = flex.text().split('\n');
  60.  
  61.   jQuery.each(text, function (i, val) {
  62.     text[i] = '<p class="inside">' + val + '</p>';
  63.   });
  64.   flex.html(text.join(' '));
  65.  
  66.   /* Flexslider To Autogenerate And Increment The Id Of Main Caption "p" Tag */
  67.   jQuery('p.flex-caption').each(function (i, el) {
  68.     el.id = 'flex-caption-' + i + 1;
  69.   });
  70.  
  71.   /* Flexslider To Display Appropriate Values From Required Main Caption "p" Tag */
  72.   jQuery("#flex-caption-51 p:nth-child(2)").css('display', 'block');
  73.   jQuery("#flex-caption-61 p:nth-child(3)").css('display', 'block');
  74.   jQuery("#flex-caption-71 p:nth-child(4)").css('display', 'block');
  75.   jQuery("#flex-caption-81 p:nth-child(5)").css('display', 'block');
  76.   jQuery("#flex-caption-91 p:nth-child(6)").css('display', 'block');
  77.  
  78.   /* Flexslider Wrapping Of Text Inside Main Caption "p" Tag */
  79.   var flex = jQuery('p.flex-url');
  80.   var text = flex.text().split('\n');
  81.  
  82.   jQuery.each(text, function (i, val) {
  83.     text[i] = '<p class="inside">' + val + '</p>';
  84.   });
  85.   flex.html(text.join(' '));
  86.  
  87.   /* Flexslider To Autogenerate And Increment The Id Of Main Caption "p" Tag */
  88.   jQuery('p.flex-url').each(function (i, el) {
  89.     el.id = 'flex-url-' + i + 1;
  90.   });
  91.  
  92.   /* Flexslider To Autogenerate And Increment The Id Of Main Caption "p" Tag */
  93.   jQuery('.flex-control-nav li').each(function (i, el) {
  94.     el.id = 'flex-nav-' + i + 1;
  95.   });
  96.  
  97.   /* Flexslider To Display Appropriate Values From Required Main Caption "p" Tag */
  98.   var str = jQuery("#flex-url-51 p:nth-child(2)").text().trim().trim();
  99.   jQuery(".flex-control-nav li:nth-child(1) a").attr("href", str);
  100.  
  101.   var str = jQuery("#flex-url-51 p:nth-child(3)").text().trim();
  102.   jQuery(".flex-control-nav li:nth-child(2) a").attr("href", str);
  103.  
  104.   var str = jQuery("#flex-url-51 p:nth-child(4)").text().trim();
  105.   jQuery(".flex-control-nav li:nth-child(3) a").attr("href", str);
  106.  
  107.   var str = jQuery("#flex-url-51 p:nth-child(5)").text().trim();
  108.   jQuery(".flex-control-nav li:nth-child(4) a").attr("href", str);
  109.  
  110.   var str = jQuery("#flex-url-51 p:nth-child(6)").text().trim();
  111.   jQuery(".flex-control-nav li:nth-child(5) a").attr("href", str);
  112.  
  113.   /* onHover Effect */
  114.   jQuery(".flex-control-nav li").hover(function () {
  115.     jQuery('.flexslider').flexslider("pause");
  116.     jQuery('.flexslider').flexslider(jQuery(this).index());
  117.   }, function () {
  118.     jQuery('.flexslider').flexslider("play");
  119.   });
  120. });
Advertisement
Add Comment
Please, Sign In to add comment