Here is what I'm trying to do:
I have an input textbox that takes a number 1 -5, User inputs a number.
Clicks a button that calls a function that takes that number and displays a popup div that corresponds to that number.
The popup that I am using is called ColorBox, it's similar to lightbox.
It works in IE but not FF, here is the code, any ideas?
Javascript
HTMLCode:function showDiv() { var num = document.getElementById("input").value; //1 = birthday, 2 = birth announcement, 3 = bridal shower // 4=wedding, 5=baby shower if (num == "1") { div = "#divBirthday"; $(document).ready(function() { //Examples of how to assign the ColorBox event to elements $(".inline").colorbox({ width: "50%", inline: true, href: "#divBirthday" }); //Example of preserving a JavaScript event for inline calls. $("#click").click(function() { $('#click').css({ "background-color": "#f00", "color": "#fff", "cursor": "inherit" }).text("Open this window again and this message will still be here."); return false; }); }); } else if (num == "2") { div = "#divBirthAnnouncement"; $(document).ready(function() { //Examples of how to assign the ColorBox event to elements $(".inline").colorbox({ width: "50%", inline: true, href: "#divBirthAnnouncement" }); //Example of preserving a JavaScript event for inline calls. $("#click").click(function() { $('#click').css({ "background-color": "#f00", "color": "#fff", "cursor": "inherit" }).text("Open this window again and this message will still be here."); return false; }); }); } }
HTML Code:<input type="text" id="input" /> <br> <input name="btnColorbox" id="btnColorbox" type="submit" value="Show Div" class="inline" onclick="showDiv();" />


Reply With Quote
Bookmarks