/    Sign up×
Community /Pin to ProfileBookmark

JavaScript snippet enabling one specific function, but disabling many others sitewide

I am performing some very minor customizations on a clients’ website, and one of those is adding a popup video feature in Fancybox. I have used the code from another programmer, and it works quite well. The only problem is, a snippet of JavaScript is disabling nearly all of my animations, including a thumbnail slider, a popdown credit card entry field, a few javascript dependent actions and animations, and anything else that requires JavaScript. Here is the snippet that is basically turning off all of my Javascript:

$(“.colcontent”).hide();
//toggle the componenet with class msg_body
$(“.coltitle”).click(function()
{
$(this).next(“.colcontent”).slideToggle(200);
});

});

When I delete this line of code, the animations work. When I insert it in (with the other bit of JavaScript), the Fancybox works, but animations do not.

Here is the full line of code:

<script type=”text/javascript”>
jQuery(document).ready(function($){

$(“#tip4”).click(function() {
$.fancybox({
‘padding’ : 0,
‘autoScale’ : false,
‘transitionIn’ : ‘none’,
‘transitionOut’ : ‘none’,
‘title’ : this.title,
‘width’ : 680,
‘height’ : 495,
‘content’ : ‘static/common_structure.html’,
‘href’ : this.href.replace(new RegExp(“watch?v=”, “i”), ‘v/’),
‘type’ : ‘iframe’,
‘iframe’ : {
‘scrolling’ : ‘auto’,
‘preload’ : ‘true’
}
});

return false;

});

$(“.pop”).fancybox({
‘width’ : 600,
‘height’ : 600,
‘autoScale’ : false,
‘transitionIn’ : ‘none’,
‘transitionOut’ : ‘none’,
‘type’ : ‘iframe’
});

$(“.webinar”).fancybox({
‘width’ : 600,
‘height’ : 400,
‘autoScale’ : false,
‘transitionIn’ : ‘none’,
‘transitionOut’ : ‘none’,
‘type’ : ‘iframe’
});

$(“.sizing”).fancybox({
‘width’ : 800,
‘height’ : 800,
‘autoScale’ : false,
‘transitionIn’ : ‘none’,
‘transitionOut’ : ‘none’,
‘type’ : ‘iframe’
});

  • * $(“.colcontent”).hide();

  • * //toggle the componenet with class msg_body

  • * $(“.coltitle”).click(function()

  • * {

  • * * $(this).next(“.colcontent”).slideToggle(200);

  • * });*
    });
  • </script>

    Any help would be greatly appreciated!!! I’m using WordPress, WooCommerce 1.65

    to post a comment
    JavaScript

    2 Comments(s)

    Copy linkTweet thisAlerts:
    @jazzmasterkcMay 08.2013 — Read into how java script is read
    Copy linkTweet thisAlerts:
    @Joseph_OrrauthorMay 08.2013 — Okay, I'm on W3C reading about it...in the meantime, is there any advisable solution for this problem? I'm a novice when it comes to JavaScript...
    ×

    Success!

    Help @Joseph_Orr spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.20,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...