Hai ,
I am using an iframe for showing a page in my website. i want to hide that frame using a close button in the content page( the page which is showing in the frame)
How to do this? use jQuery
See this image
You can use a client side script to make the iframe invisible. Lets consider the IFrame is inside a div <div id="iFrameContainer"><iframe></iframe></div>. In such a case you can fire a javascript on click of the button and set something like document.getElementById("iFrameContainer").visible=false; This should work for you.
have your iframe in your div tag. Then execute the following statement for hiding or displaying respectively when button get onclick event.
document.getElementById('iframeid').style.display='none'; // hiding
document.getElementById('ifrmaeid').style.display='block'; // displaying
As iframe is html control it will pruduce an erroe while running it at the sever...
To make the iframe hide or show at particular condition ... we can use apply simple trick.. take a div element which will wrap the iframe element.. eg
<div id="vidPreview" runat="server" visible="false">
<iframe src="demo.aspx" width="400" height="200" frameborder="0" style= "background-color:Black;"></iframe>
</div>
When u want to make visible just make that div's visibility property=true
in above eg make...vidPreview=true whenever i want to display iframe..
Related
I have an html page where we have images,text and two buttons
1.print page for printing the page
2.Hide/Show(toggle button) for hide/show below the image.
image in the page are generated dynamically using remote service.
In Google-Chrome
When I click Hide/Show button to hide image and click print button,print preview page comes on the same page.
Then I cancel print page and back to page.
Then I again click Hide/Show button to show image
here the problem is that image is not shown on the page.
Using firebuglite I found that inline css style like width and height for image are 0 and hence image is not shown on the page.
How can I manage the css style for image after print preview and this problem occurs only in Chrome.
Please help.
here is CSS Browser Selector using javascript:
http://rafael.adm.br/css_browser_selector/
you can use that,then add the class:
.chrome #btn{
height:30px !important;
width:100px !important;
}
have a very basic page that I am working on that contains thumbnail images and a main image. When the thumbnail images are clicked I am using document.getElementById to change the main image. Easy to do but I now want to change my main image from landscape to portrait. This will mean that now when clicking the thumbnail I will not only need to change the main image but also the div tag dimensions. I am new to Javascript and was wondering if someone could give me a quick point in the right direction of how to go about this.
Thank you in advance for any help,
Margate
I would suggest adding/changing a CSS style class on the element and then configuring that class with all the necessary modifications. There's a lot you can do with just CSS.
You can either use a semi colon in your onclick event and add more javascript calls, or create a JavaScript function that will do all of your neccesary changes and call that method from your onclick event.
function changeStuff(){
document.getElementById("myThing").DoStuff()
document.getElementById("myOtherThing").DoOtherStuff()
}
<div id="myThing">
<img id="myOtherThing" onclick="cangeStuff();"></img>
</div>
Is there a way to REMOVE a DIV of the master page? not hide, there are some hyperlinks in the div, so I want to remove them from the code as well. thanks
By using HTML DOM you can actually remove any element you want. You need to use JavaScript or jQuery to achieve this.
var div = document.getElementById("task_row_" + taskId);
div.parentNode.removeChild(div);
Reference: Remove DIV tag using Javascript or Jquery
You could do the following:
<div id="random_name" runat="server" visible="false">
content
</div>
That will allow you to hide the div, but also from the .net show & hide it as well using.
random_name.visible = true
The use of Visible, doesn't just hide it from the view but show it in the code, it completely hides it, not view able by the client at all.
For changing content of master page from child page check out my answer from:
Disable Hyperlink of Master page from content page
I want to go different DIV in another file using Anchor tag.
Like->
Click Here to go to another div
And Different_File.aspx will have some div as <div id = "thisDiv"> </div>
The way I have shown does not work :(
Whats wrong with it ??
I know its simple but I am not able to do it.
Hi check to live demo
http://jsfiddle.net/rohitazad/WNzfT/4/
if you put the next anchor link in your web page
than
as like this
click here
I would like to add div's and text to a specific DIV with ASP.NET, i have only found code which allowed controls to be added to the body but not to a specific Div.
I'm assuming you want to add controls and text to the div element server-side. If so, you can simply add runat and id attributes to the div and it will be available to you on the server.
For example, if you have a div on your page declared like this:
<div id="MyDiv" runat="server"></div>
You can add text, html content or other controls to it using the following:
MyDiv.InnerText = "some inner text"; // adding text
MyDiv.InnerHtml = "<div>inner html</div>"; // adding html
MyDiv.Controls.Add(new LiteralControl("a literal control")); // adding a control
Change the outer div to an <asp:Panel control. A Panel renders to html as a normal div, and will make it easy to add items from server code.