Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //var site = {"ajaxurl":"http:\/\/localhost:8888\/assylum\/www\/wp-admin\/admin-ajax.php"};
- var site = {"ajaxurl":"http:\/\/www.ocastaneda.co\/clientes\/coffeestore\/wp-admin\/admin-ajax.php"};
- var jq = jQuery.noConflict();
- jq(document).on('ready', function(event) {
- console.log('inicio');
- jq('#recetas #cat').on('change',function(event) {
- jq("#preloader-re").show();
- jq("#load-re").show();
- var cat = jq('#recetas #cat option:selected').text(),
- post_id = jq(this).data('id'),
- projectTitle = jq(this).data('title'),
- projectSlug = jq(this).data('slug'),
- ajaxURL = site.ajaxurl;
- jq.ajax({
- type: 'POST',
- url: ajaxURL,
- cache: false,
- context: this,
- data: {'action': 'load-category_content', post_id: post_id, cat: cat },
- success: function(response) {
- jq('#lista-recetas ul').html(response);
- return false;
- },
- complete: function(){
- jq("#preloader-re").delay(100).fadeOut("slow");
- jq("#load-re").delay(100).fadeOut("slow");
- }
- });
- });
- jq(document).on('click','a.post-link', function(e) {
- e.preventDefault();
- jq("#preloader-re-int").show();
- jq("#load-re-int").show();
- jq(this).addClass('active').removeClass('inactive').parent().siblings().find('a.post-link').addClass('inactive').removeClass('active');
- var post_id = jq(this).data('id'),
- projectTitle = jq(this).data('title'),
- projectSlug = jq(this).data('slug'),
- ajaxURL = site.ajaxurl;
- jq.ajax({
- type: 'POST',
- url: ajaxURL,
- cache: false,
- context: this,
- data: {'action': 'load-content', post_id: post_id },
- success: function(response) {
- jq('#project-container').html(response);
- return false;
- },
- complete: function(){
- jq("#preloader-re-int").delay(100).fadeOut("slow");
- jq("#load-re-int").delay(100).fadeOut("slow");
- }
- });
- });
- new WOW().init();
- function ir(ele) {
- var coor = ele.offset();
- var conv = coor.top;
- jq('html, body').animate({
- scrollTop : conv
- });
- }
- if(jq('#site-navigation').length > 0){
- jq("a[href*='-inicio']").each(function() {
- var enlace = jq(this).attr('href');
- jq(this).on('click', function(event) {
- event.preventDefault();
- ir(jq(enlace));
- window.location.hash = enlace;
- });
- });
- jq('#elemento').on('click', function(){
- ir(jq('#elemento'));
- });
- }
- jq(window).load(function() {
- jq("#preloader").delay(100).fadeOut("slow");
- jq("#load").delay(100).fadeOut("slow");
- var hashtag = window.location.hash;
- if(hashtag){
- console.log(hashtag);
- ir(jq(hashtag));
- }else{
- console.log('nada');
- }
- });
- var links = jq('#int-productos .cont ul li').length;
- jq('#int-productos .cont ul li').each(function(links) {
- console.log(links);
- jq(this).on('click', function() {
- jq(this).addClass('active').removeClass('inactive').siblings().addClass('inactive').removeClass('active');
- event.preventDefault();
- jq('.cont-descripcion .descripcion:eq('+links+')').addClass('animated flipInY').removeClass('zoomOutDown').show().siblings('.descripcion').removeClass('animated flipInY').addClass('zoomOutDown').hide();
- jq('.cont-empaque .ima-empaque:eq('+links+')').addClass('animated flipInY').removeClass('zoomOutDown').show().siblings('.ima-empaque').removeClass('animated flipInY').addClass('zoomOutDown').hide();
- });
- });
- var addEvent = function(object, type, callback) {
- if (object === null || typeof(object) == 'undefined') return;
- if (object.addEventListener) {
- object.addEventListener(type, callback, false);
- } else if (object.attachEvent) {
- object.attachEvent("on" + type, callback);
- } else {
- object["on"+type] = callback;
- }
- };
- function cambiar(){
- var responsive_viewport = jq(window).width();
- if (responsive_viewport > 480) {
- }
- if (responsive_viewport < 800) {
- // cambio de orden noticias
- if(jq('.wrap-noticias').length > 0){
- jq('.wrap-noticias').each(function(index, el) {
- var text = jq(this).find('.info-tit');
- jq(this).find('.imagen-noticia').insertAfter(text);
- });
- }
- // cambio de orden noticias
- if(jq('.wrap-promociones').length > 0){
- jq('.wrap-promociones').each(function(index, el) {
- var text = jq(this).find('.info-tit');
- jq(this).find('.imagen-promociones').insertAfter(text);
- });
- }
- /*cambio orden productos */
- if(jq('.wrap-prod').length > 0){
- jq('.wrap-prod').each(function(index, el) {
- var text = jq(this).find('.cabezote-prod');
- jq(this).find('.cont-descripcion').insertAfter(text);
- });
- }
- if(jq('.wrap-prod').length > 0){
- jq('.wrap-prod').each(function(index, el) {
- var text = jq(this).find('.cont-prod');
- jq(this).find('.ima-prod').insertAfter(text);
- });
- }
- }
- if (responsive_viewport > 800) {
- if(jq('.wrap-prod').length > 0){
- jq('.wrap-prod:odd').each(function(index, el) {
- var text = jq(this).find('.cont-prod');
- jq(this).find('.ima-prod').insertAfter(text);
- });
- jq('.wrap-prod:even').each(function(index, el) {
- var text = jq(this).find('.cont-prod');
- jq(this).find('.ima-prod').insertBefore(text);
- });
- }
- jq('#masthead').affix({
- offset: {
- top: 100,
- bottom: function () {
- return (this.bottom = jq('.footer').outerHeight(true));
- }
- }
- });
- }
- if (responsive_viewport > 992) {
- if(jq('.wrap-noticias').length > 0){
- jq('.wrap-noticias').each(function(index, el) {
- var text = jq(this);
- jq(this).find('.imagen-noticia').appendTo(text);
- });
- }
- // cambio de orden noticias
- if(jq('.wrap-promociones').length > 0){
- jq('.wrap-promociones').each(function(index, el) {
- var text = jq(this);
- jq(this).find('.imagen-promociones').prependTo(text);
- });
- }
- /*cambio orden productos */
- if(jq('.wrap-prod').length > 0){
- jq('.wrap-prod').each(function(index, el) {
- var text = jq(this).find('.cont-empaque');
- jq(this).find('.cont-descripcion').insertAfter(text);
- });
- }
- }
- }
- cambiar();
- addEvent(window, "resize", function(){
- cambiar();
- });
- //Enable swiping...
- jq(".carousel-inner").swipe( {
- //Generic swipe handler for all directions
- swipeLeft:function(event, direction, distance, duration, fingerCount) {
- jq(this).parent().carousel('next');
- },
- swipeRight: function() {
- jq(this).parent().carousel('prev');
- }
- });
- jq('#nosotros-inicio article section').readmore({
- speed: 75,
- embedCSS: false,
- collapsedHeight: 255,
- heightMargin: 50,
- moreLink: '<div class="row vermas"><div class="col-md-12"><a class="btn" href="#"><span data-hover="Conoce más">Conoce más</span></a></div></div>',
- lessLink: '<div class="row vermas"><div class="col-md-12"><a class="btn" href="#"><span data-hover="Conoce menos">Conoce menos</span></a></div></div>'
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement