#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2011
    Posts
    306
    Rep Power
    6

    Javascript/jquery CSS not working in IE


    I am not sure if this code is javascript or jquery so I apologize in advance. I am having a problem with the auto search in IE. It works correctly in Firefox.


    and then start typing the word cart in the search bar. You will see it lines up underneath in Firefox but is not in IE. Any help would be greatly appreciated!

    Here is the code:

    Code:
    <script type="text/javascript">
    function findPos(obj) {
    var curleft = curtop = 0;
    if (obj.offsetParent) {
        do {
            curleft += obj.offsetLeft;
            curtop += obj.offsetTop;
        } while (obj = obj.offsetParent);
    }
    return curleft.toString() + ' ' + curtop.toString(); }
    (function() {
    var nxt_host = (("https:" == document.location.protocol) ? "https://" : "http://"); nxt_host += "vector.nextopiasoftware.com/";
    document.write(unescape("%3C") + "script src='" + nxt_host + "nxt-ac-js-1.3-min.js' type='text/javascript'" + unescape("%3E%3C/script%3E"));
    document.write(unescape("%3C") + "link rel='stylesheet' type='text/css' href='" + nxt_host + "ac-1.3.css'" + unescape("%3E")); })(); </script> <script type="text/javascript">
    (function() {
    var jnxtac = jQuery.noConflict(true);
    jnxtac("#myInput").css('z-index', '20000');
    jnxtac("#myInput").autocomplete({cid:'80c356394c27c27aacf41c465e455f7d'});
    })();
    if (navigator.appVersion.indexOf("MSIE") != -1) {
    var offsets  = findPos(document.getElementById('search')).split(' ');
    var acStyleEl = document.createElement('style');
    var acStyleCss = '.ui-autocomplete {position:absolute !important;left: ' + (parseInt(offsets[0]) +200) + 'px !important; top: ' + (parseInt(offsets[1]) + 24) + 'px !important;}';
    var bodyEl = document.getElementsByTagName('body')[0];
    acStyleEl.setAttribute("type", "text/css");
    acStyleEl.setAttribute("id", "acCssElement");
    bodyEl.appendChild(acStyleEl);
    acStyleEl.styleSheet.cssText = acStyleCss; }
        </script>
    Any help would be greatly appreciated!
    Last edited by tech0925; December 28th, 2012 at 01:39 AM.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2011
    Posts
    306
    Rep Power
    6
    I found the problem. The code was breaking in another JavaScript file

IMN logo majestic logo threadwatch logo seochat tools logo