DIV being obstructed by an IFRAME

I am facing an issue with my ASP.NET site where I have used an Ajax Control Toolkit Animation Extender to animate a div flying out, which contains a simple treeview.

Upon selecting a node in the treeview, a protected sub is triggered, setting the source of an IFRAME on the page to another aspx page:

Protected Sub TreeView1_SelectedNodeChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TreeView1.SelectedNodeChanged
    if1.Attributes.Add("src", "Open.aspx")
    if1.Style.Add("z-index", "-1")
    if1.Style.Add("position", "absolute")
End Sub

In the open.aspx page, I am reading a PDF file into a byte stream:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    Response.Clear()
    Response.ContentType = "application/pdf"
    Dim xByteStream(1) As Byte
    Dim b = File.ReadAllBytes(Server.MapPath("reportFrameset.pdf"))
    Response.BinaryWrite(b)
    Response.End()
End Sub

The problem arises before the iframe loads the PDF, where the div appears on top of the iframe but then moves behind it once the pdf is opened.

I have tried various positioning and z-index adjustments without success:

<div style="position:absolute; top:50px; left:20px; z-index:-1; width:400px; height:300px;">
  <iframe id="if1" name="if1" width="100%" height="50px" runat="server">
  </iframe> 
</div>

I am seeking assistance to ensure that the menu always appears on top of the iframe even when a PDF is loaded. If needed, you can access the website project in Visual Studio 2008 format via Dropbox:

Answer №1

Upon further investigation, I stumbled upon a helpful resource about z-index issues in Internet Explorer when dealing with PDFs within iframes.

Although the solution provided by Jordan Gray initially worked for my test site, it proved to be ineffective when applied to my actual website due to other conflicting CSS and elements. After investing considerable time into this issue, I ultimately opted for a simpler alternative.

Special thanks to San for offering assistance during this process.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Implement a functionality to retrieve uploaded files by utilizing the onChange event of a

I'm currently working on converting this jQuery code to React: //Js $(".custom-file-input").on("change", function() { var files = Array.from(this.files) var fileName = files.map(f =>{return f.name}).join(", ") $( ...

How can I assign a distinct background color to individual sections in Chart.js?

Wanting to Customize Grid Background Colors in Line Chart using react-chartjs-2 I am looking to have different background colors for each grid in my Line chart. Is this functionality possible with the react-chartjs-2 library? This is the desired appearan ...

Issues with Bootstrap glyphicon not functioning correctly on mobile devices and Internet Explorer

Within my template, there is a navigation button positioned on the left side of the page that remains fixed as the user scrolls down. When clicked, this button triggers a menu to appear. Embedded within this button is a bootstrap glyphicon: <div class ...

Steps to automatically fill out a form with the last ID retrieved from MySQL upon submission

I am currently developing an order form that will populate data in two MySQL tables: "order" and "order_details." Both tables contain the order_number column. To simplify this process, I have created a third table named "order_num" that stores order number ...

Tips for transferring data from a controller to $scope in the MVC architecture with AngularJS

I'm a beginner when it comes to AngularJS, currently working with an MVC5 application. I have set up a module and controller in the Angular JS for this application. Within my customer controller in MVC5, I have an action called "View" where I need to ...

Adding a mute/unmute button to your web browser's audio player: A quick guide

My code is functioning perfectly, but I am facing an issue with the lack of mute/unmute buttons. Can someone please help me figure out how to add them? <audio src="MUSIC URL" autoplay loop> <p>Your browser does not support the audio elem ...

Troubleshooting textarea resize events in Angular 6

In the development of my Angular 6 application, I have encountered an issue with a textarea element. When an error occurs, an asterisk should be displayed next to the textarea in the top-right corner. However, there is a gap between the textarea and the as ...

Is there a way to display my <i> tags inline without any issues?

I am facing an issue with my code and need assistance. I have two links that I want to display but my code doesn't seem to respond as expected. The first link is: https://i.sstatic.net/fryPH.png The second link is: https://i.sstatic.net/j849M.png A ...

How to use jQuery to retrieve the second and third elements from a sorted list

Our task is to modify the URL of the image for the second and third elements within an ordered list using jQuery without converting the list to an unordered list. We are looking for a solution to specifically target and modify the class or image of these t ...

Display a tooltip when you click on a different element

I have a unique feature that I want to implement on my website. The idea is to display a tooltip when a user clicks on a specific div with the same ID as the tooltip. This will be particularly useful for interactive questions where users can click and reve ...

List output with jQuery AJAX showing object data

Here is my code that utilizes ajax for searching: $("#keyword").keyup(function() { var keyword = $("#keyword").val(); if (keyword.length >= MIN_LENGTH) { $.get( "./lib/data_siswa_ajax.php", { keyword: keyword, sekolah: $("#sekolah").val ...

Do not allow navigation to another page until the form has been submitted

As part of my project, I have implemented a feature where new users are required to change their password upon logging into their account for the first time. For new users, the Change Password screen is displayed immediately after login. The menu options ...

How can I center a Bootstrap modal vertically and make it responsive?

Is there a way to vertically center the bootstrap modal? I have been searching for a solution, but none seem to be responsive or effective. My website is using Bootstrap 3. The modal does not adjust properly on smaller screens or when the browser window i ...

explore the route with the help of jquery scrolling feature

Is there a way to implement scrolling functionality for tab headers similar to this demo? I have a list of elements within a div that I need to scroll like the tabs in the demo. I attempted to achieve this by setting the position of the inner elements to ...

Find the dominant color within the project's style sheets

Is there a method to extract the main color from an angular material theme and apply it in the css files of an angular project? Within a project, we can specify the primary color in a *.scss document as shown below: @import '~@angular/material/themi ...

Slicing a URL using JavaScript or jQuery

Hey everyone, I have a question: Can I remove the initial section of a URL? var mydir = $("script[src$='jquery_main.js']").attr('src').slice(0, -14); http://127.0.0.1:9081/Mgr/resources/ui/skins/default/js/main/ I want to get rid of ...

Internet Explorer has encountered a JavaScript error and is unable to retrieve the value of the property '0':

My current setup includes: <img id="uploadedimage" alt="uploaded image" src="" width="250px" height="250px"/> I use a div to showcase the selected image using this jQuery script: $('#BusinessImage').change(function (ev) { va ...

How to retrieve the selected text from a specific <span> using JavaScript

Is there a way to extract only the selected text from a specific span element? <span style="font-size:40px">Hi tTheee</span> <span style="font-size:20px">hello</span> <span style="font-size:20px">sdsds </span> Current ...

Activate the file upload window when an option is chosen from the dropdown menu

Is there a way to automatically trigger the file input when "UploadStudents" is selected from the dropdown menu? Dropdown Menu <select name="performaction" id="performaction"> <option value="">- Actions -</option> <option value=" ...

Accordion Widget in Bootstrap fails to initiate with proper icon

I recently designed a webpage showcasing different parts of a privacy policy. Using Bootstrap and its accordion feature, I successfully displayed the information with standard icons. However, I encountered an issue where the accordion initially loads with ...