views:

600

answers:

0

In my work i changed the dialogue boxes for fancybox, all went dandy, even with minor problems, such as making it run on pageload, but nothing that i could not managed.

but now, I am facing a enormous obstacle:
IE6 and IE7 untamed behaviour. I need to change the url of the place where fancybox is going to show. I could not find anything in the documentation except to add content, but not a id. So my question is: where am I wrong?

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title></title>
 <link rel="stylesheet" type="text/css" href="http://fancybox.net/js/fancybox/jquery.fancybox-1.3.0.css" media="screen" />

 <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.1.min.js"&gt;&lt;/script&gt;
 <script type="text/javascript" src="http://fancybox.net/js/fancybox/jquery.easing-1.3.pack.js"&gt;&lt;/script&gt;
 <script type="text/javascript" src="http://fancybox.net/js/fancybox/jquery.mousewheel-3.0.2.pack.js"&gt;&lt;/script&gt;

 <script type="text/javascript" src="http://fancybox.net/js/fancybox/jquery.fancybox-1.3.0.pack.js"&gt;&lt;/script&gt;

    <script>

        $(document).ready(function() {

        jQuery.fn.cornyBox = function(selector) {

            if (selector) { this.attr('href', selector); }

            $(this).fancybox();

        };


       //$('#aAlert').cornyBox();
        $('#aAlert').cornyBox('#dvAlert2');

        });


    </script>
</head>
<body>
    <div id="alertHolder">
        <a id="aAlert" href="#dvAlert1" >hit me</a>
        <div id="dvAlert1" class='alert'>
            something
        </div>

        <div id="dvAlert2" class='alert'>
            something else
        </div>
    </div>  
</body>
</html>

If I use $('#aAlert').cornyBox(); I have no problems, because obviously i set no new href on the link.
It works on IE8, Firefox and Chrome. In IE6, IE7, not, though.