Is ghere some issue with Javascript used ina Wordpress theme?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Angry Jew Cat - Banned for Life
    (felis madjewicus)
    • Jul 2006
    • 20368

    #1

    Is ghere some issue with Javascript used ina Wordpress theme?

    Trying to add in a dhtml popover for an opt-in box and it totally fucks up the whole theme. Drop it into any static page and it works fine. Put it into the wordpress theme and it provides a blank page. is there some issues with javascript in the theme too? i thought javascript issues were restricted to use in posts?
  • Jdoughs
    Confirmed User
    • Mar 2004
    • 5794

    #2
    Hard to tell without seeing the site, but NO there is no issues using Java, I've got atleast 2 that run heavy java on all pages.
    LinkSpun - Premier Adult Link Trading Community - ICQ - 464/\281/\250
    Be Seen By New Webmasters/Affiliates * Target out webmasters/affiliates based on niches your sites are for less than $20 a month.
    AmeriNOC - Proudly hosted @ AmeriNOC!

    Comment

    • Libertine
      sex dwarf
      • May 2002
      • 17860

      #3
      It's probably a conflict with some other code in the theme. Simply changing the names of variables and/or divs could solve that.
      /(bb|[^b]{2})/

      Comment

      • Angry Jew Cat - Banned for Life
        (felis madjewicus)
        • Jul 2006
        • 20368

        #4
        Originally posted by Libertine
        It's probably a conflict with some other code in the theme. Simply changing the names of variables and/or divs could solve that.
        i never thought that could be the issue. i'll look it over but i don't think thats it. i just checked and the styles for the form are all added into the div tags.
        Last edited by Angry Jew Cat - Banned for Life; 09-06-2009, 08:30 AM.

        Comment

        • Angry Jew Cat - Banned for Life
          (felis madjewicus)
          • Jul 2006
          • 20368

          #5
          anyone see anything that could potentially interfere with wordpress in this?

          Code:
          <script language="JavaScript1.2">
          var ie=document.all
          var dom=document.getElementById
          var ns4=document.layers
          var calunits=document.layers? "" : "px"
          
          var bouncelimit=32 //(must be divisible by 8)
          var direction="up"
          
          function initbox(){
          if (!dom&&!ie&&!ns4)
          return
          crossobj=(dom)?document.getElementById("dropin").style : ie? document.all.dropin : document.dropin
          scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
          crossobj.top=scroll_top-250+calunits
          crossobj.visibility=(dom||ie)? "visible" : "show"
          dropstart=setInterval("dropin()",50)
          }
          
          function dropin(){
          scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
          if (parseInt(crossobj.top)<100+scroll_top)
          crossobj.top=parseInt(crossobj.top)+40+calunits
          else{
          clearInterval(dropstart)
          bouncestart=setInterval("bouncein()",50)
          }
          }
          
          function bouncein(){
          crossobj.top=parseInt(crossobj.top)-bouncelimit+calunits
          if (bouncelimit<0)
          bouncelimit+=8
          bouncelimit=bouncelimit*-1
          if (bouncelimit==0){
          clearInterval(bouncestart)
          }
          }
          
          function dismissbox(){
          if (window.bouncestart) clearInterval(bouncestart)
          crossobj.visibility="hidden"
          }
          
          function truebody(){
          return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
          }
          
          window.onload=initbox
          </script>

          Comment

          • harvey
            Confirmed User
            • Jul 2001
            • 9266

            #6
            it depends 100% on the scripts the theme (or your plugins) use. Sometimes some scripts conflict with others, the best way to avoid this is to use all jquery, or all scriptaculous or all mootools or whatever. Do a search for jquery noconflict and you'll find a non-conflict version that solves this kind of problems MOST of the times (not always)

            bah, don't search anything, just go here

            Of course, you could use another theme if the above doesn't solve things.

            Another possibility is that you may have CSS styles overriden by some script, check out if you have CSS elements declared twice (in the same or different stylesheets)
            This post is endorsed by CIA, KGB, MI6, the Mafia, Illuminati, Kim Jong Il, Worldwide Ninjas Association, Klingon Empire and lolcats. Don't mess around with it, just accept it and embrace the truth

            Comment

            Working...