I have what I think should be a simple thing to do but everything I've tried has been a bust.
I have an iframe in a mobile web page, looks nice, finger swipe scrolling in the major os's without any code. But I'd like the iframe to open the map.html to a specific coordinate, the map.html is just an image of a map, nothing else.
Code on the page embedding the iframe:
<iframe id="iframe2" width="292" height="350" frameborder="0" scrolling="yes" marginheight="0" marginwidth="0" src="map.html"></iframe>
Code for map.html
<html>
<head>
</head>
<body>
<div style="width:292px;height:350px;frameborder:1;marginheight:0;marginwidth:0;overflow:scroll;" >
<img src="images/map.png">
</div>
</body>
</html>
Is there some javascript that I could put on either the page holding the iframe or in the map.html that would scroll map.html to something like 50px,50px?
I think I'll give up on this idea... embedded the image in the page instead of iframing an HTML page, then set user-scalable=yes, (it's a mobile thing)... I was hoping for something more elegant, but this is eminently usable and simple to build.
Thanks anyways!
Maybe that was Shmiddty's point, one of those 'what is the sound of one hand clapping?' sort of questions/lessons!!!
Related
I want to remove that download icon that is in the PDF viewer, but I can't. I'm opening the pdf through an iframe. Here is an example of my code below:
<html>
<head>
<title>Disable Context Menu</title>
</head>
<body oncontextmenu="return false">
<iframe id="pdfFrame" width="500px" height="600px" src="png.pdf"></iframe>
</body>
</html>
First I tried to apply a style inside the page opened by the iframe, but I couldn't succeed in that.
Change:
<iframe id="pdfFrame" width="500px" height="600px" src="png.pdf"></iframe>
In:
<iframe id="pdfFrame" width="500px" height="600px" src="png.pdf#toolbar=0"></iframe>
Hope that helped!
You cannot simply change the view of a PDF when you placed it in the Distributed Network System (WorldWideWeb) it became just the same as EVERY item in the Public Domain an embedded object for download and view.
You can make suggestions as to how those dis-positions may be handled (see how I suggested via a fragment the second frame could be #toolbar=0) but once you publish html objects they are no longer yours to control.
Most browsers will come with their own editors to remove that just as easy as you can add it.
There are ways google can make it more difficult to extract the source PDF copy but if the client can view it a copy has already been gifted (dis-possessed) to them.
<html>
<head>
<title>Disable Context Menu</title>
</head>
<body oncontextmenu="return false">
<iframe id="pdfFrame" width="500px" height="600px" src="https://docs.google.com/viewerng/viewer?url=http://infolab.stanford.edu/pub/papers/google.pdf&embedded=true"></iframe>
</body>
</html>
For example, I want to make an iframe to this url: http://example.com/game.swf
The problem is, users who are on different browsers/devices/settings have the issue where instead of running the swf, the browser is just downloading it.
Keep in mind, I don't have access to the code for http://example.com, or the fla file. I need to use the iframe hack because of some issues with the swf.
The iframe must load an HTML file, instead of directly loading some SWF file. So get around that rule by embedding SWF within the same html that the iFrame will be loading.
If iframe has code:
<iframe src="http://example.com/game.html"> </iframe>
Then in game.html have code:
<!DOCTYPE html>
<html>
<body>
<embed src="http://example.com/game.swf" width="800" height="600">
</body>
</html>
I trying to display my ppt with long time where the screen should run continuously in web page where the file is in my local folder but it is not showing in web page. The code is below :
<!DOCTYPE html>
<html>
<body>
<iframe src="lp.ppt" width="800px" heigt="600px" name="iframe_a"></iframe>
</body>
</html>
can anyone help to display ppt in html page.
You can use Google Docs to serve as your document viewer. You just need to upload your file and use the share link as the iframe src.
You can get the embed code by uploading your file and opening it in google docs (in this case, Google Slides) then click the file tab and click the Publish to the Web. From there you can copy the embed code. Make sure that the file is public! :)
<iframe src="https://docs.google.com/presentation/d/17nlO95lz91-shRep16UiJl-3EAxv-MnOFH718ku2gtw/embed?start=false&loop=false&delayms=3000" frameborder="0" width="960" height="749" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true"></iframe>
<iframe src="https://docs.google.com/presentation/d/17nlO95lz91-shRep16UiJl-3EAxv-MnOFH718ku2gtw/embed?start=false&loop=false&delayms=3000" frameborder="0" width="960" height="749" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true"></iframe>
Hope this helps!
I have been trying to display PDF inside iFrame, it works well for all other browsers and platforms but not working with iOS. When I tried to access in chrome/Safari in iPhone/iPad, it shows the first page BUT does not allow to scroll down the PDF. And when it comes to HTML inside iFrame, it works perfectly, per my observation it looks like issue is with PDF inside iFrame on iOS. Tried all the links provided on various websites, overflow-auto, webkit scrolling, scrolling only y axis, position absolute/relative increasing the height which results in white pages and all other possible solutions, but no luck yet. The language of implementation is ASP.NET-C# where I am setting the iFrame source dynamically. Below is the source through which I am trying to achieve above task.
<div id="wrapper" class="Sales-container container">
<iframe runat="server" id="Contents" class="myiframe" scrolling="no" width="100%" height="100%" frameborder="0" />
</div>
.Sales-container{position:absolute !important;width:100%}
.container{margin-right:auto;margin-left:auto;padding-left:7px;padding-right:8px}
.myiframe{z-index:0;white-space:nowrap}
Any help would be much appreciated.
Thanks.
If you don't need https, you can use the google docs viewer
make the src http://docs.google.com/gview?url=YOURADDRESSHERE&embedded=true
If that won't work for you, I'm currently looking into pdf.js
I have a simple html page with an iframe image link. After the page loads I want the link to be clicked automatically. I need the link to be clicked instead of doing a meta refresh so thats out of the question. I searched around and It seems like FireFox does not support any methods to do so...There has to be a cross browser solution. Here is what I have so far but it wont work...why?
<script type="text/javascript">
window.onload=functionName;
$(document).ready(function(){
$('#clicked').trigger('click')
});
</script>
<div id="clicked">
<iframe src="http://mysource.com" width="40" height="10" scrolling="no" border="0" marginwidth="0" style="border:none;" frameborder="0"></iframe>
</div>
Add # before the id value
$('clicked').trigger('click');
to
$('#clicked').trigger('click')
If the iframe is on your domain then you can access its contents via jquery selectors.
Otherwise you're out of luck - blocking cross domain iframe interactions is a feature of same-origin policy that exists to protect users.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#Scripting