When the user clicks on a particular question, I am using javascript/JQuery to show the appropriate answer below that question. Due to differences b/n IE vs other browsers (FF, Safari), I had to use two different methods to show the answer, but I did get this to work in all cases.
The sticking point comes when I want to use an answer to be able to link to another page to supply the details of that answer. Again, the non-IE browsers work - user clicks on a question, the "answer" is shown, and they can click on the shown link to redirect to the desired page. In IE however, the shown link does not work when clicked, but if you hover over it, the cursor behaves as if it is an active link and you can see the new page path displayed on the status bar. I believe the link does not work b/c IE thinks the preventDefault or return false; conditions are still in effect, even though those conditions are no longer true. see [code] below...
Does anyone know if it is possible to "deactivate" a link in IE in order to show additional text, but then subsequently "reactivate" normal linking behavior once the hidden text has been displayed?
Expand|Select|Wrap|Line Numbers
- <script type="text/javascript">
- var name = navigator.appName
- if (name != "Microsoft Internet Explorer") {
- $(document).ready(function() {
- $(".faq_answer").hide();
- $("#faqs li").toggle(
- function() {
- $(this).next(".faq_answer").show();
- },
- function() {
- $(this).next(".faq_answer").hide()
- }); // end toggle
- }); // end ready
- } else {
- $(document).ready(function() {
- $(".faq_answer").hide();
- $('#faqs li a').click(function(evt){
- $(this).next('p').slideToggle(1);
- return false;
- });
- $("#faqs #faq_link").click(function(evt) {
- $(this).next('p a').open("http://www.nebraskaredzone.com/Banners/banners.html"); THIS CODE IS NOT WORKING
- });
- }); // end ready
- }; // end if
- </script>