I Found A Cross Platform Pop Up Script That Centers
Jul 9, 2005
OK, I think I found the perfect cross platform solution for centered popup windows. I found it on the site of Panic.com, I hope Cabel won't mind ;-)
The trick for all problems is to have a JavaScript that distinguishes between different platforms.
Here's the sample page which will bring up - upon click on a link - a pop up of 500 by 300 pixels. I used as link www.apple.com -- just an example.
To have scroll bars, resizability, etc work, simply change the digit "0" to "1" in all 3 ocurrences.
<html>
<head>
<script type="text/javascript" language="JavaScript">
<!--
// POPUP
var isNav4, isIE4, isMac;
if (parseInt(navigator.appVersion.charAt(0)) >= 4) {
isNav4 = (navigator.appName == "Netscape") ? true : false
isNav6 = (navigator.appName == "Netscape" && parseInt(navigator.appVersion) == 5) ? true : false
isIE4 = (navigator.appName.indexOf("Microsoft") != -1) ? true : false
isMac = (navigator.platform.indexOf("Mac") != -1) ? true : false
}
function popup(url, winWidth, winHeight) {
if (isNav4 || isIE4) {
var screenPosX,screenPosY;
screenPosX = (screen.availWidth - winWidth) / 2;
screenPosY = (screen.availHeight - winHeight) / 2;
if (isNav4 || isNav6) {
window.open(url, 'subwin','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0, copyhistory=0,width='+winWidth+',height='+winHeight+',screenX='+screenPosX+',screenY='+screenPosY+'' );
}
if (isIE4) {
newwin = window.open(url, 'subwin','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0, copyhistory=0,width='+winWidth+',height='+winHeight+',left='+screenPosX+',top='+screenPosY+'');
}
}
else {
window.open(url, 'subwin','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0, copyhistory=0,width='+winWidth+',height='+winHeight+'');
}
}
//-->
</script>
<a href="http://www.apple.com/" onClick="popup('http://www.apple.com/',ò“',âÆ'); return false;">Click here for pop-up</a>
</body>
</html>
View 1 Replies
ADVERTISEMENT
Jun 12, 2003
I need to make my site viewable for both PC and Macintosh. For PC the "HV Menu" works very good but it screws up on a Mac. So I've configured "Top Navigational Bar 3 v3.4.1.1b" to work on a Mac.
Both of the menus use SCRIPT REL/SRC-links to external js-files implemented in the HTML-code of the site (that's 1standard I guess). So what I need is a platform-check in the HTML-code that decides wich menu that will show!
Down below I attach the scripts from each menu.
View 13 Replies
View Related
Jan 11, 2010
I need to upload/read an xml from a local drive of any platform (linux, windows, mac) and synchronize it with my web server, which will then update my DB. Local xml file path is predefined and stored in my DB. This is part 1.Part 2, I will have to update the sync(ed) xml and replace the file on my local drive.Part 1 and part 2 will execute in sequence when the user click on a "Sync" button after logged in.Here is what I plan to use, PHP, MySQL, Javascript.What I know so far.1. Due to security reasons we cannot dynamically update the value of the input file type. So setting the known file location is not possible.I will like to know if there is anyway we can upload/read & overwrite a xml file without any middleware like adobe air that needs to be pre-installed to any of the platform to achieve what I plan to do?
View 5 Replies
View Related
May 21, 2010
Is it possible to extract information which is located in a predefined area on the screen from a java platform?
For example, there is java based platform which I can see on my screen.
This platform contains numbers/letters.
The location of these numbers/letters does not change, i.e. the script would not need to be adjusted if the field, which contains the info, would move.
Lets assume the screen would look like that:
The info between the fields would be clearly separated.
Now I would like to extract the infos from all the fields and paste the info for example in EXCEL so that I can see "Valerie12345" in .xls field A1 / 12.20 in A2 / Love in B1 etc...if that is possible to extract?
View 1 Replies
View Related
Jun 18, 2009
Is there any way to resize an iframe dynamically to the height of its content that works cross browser and works when the iframe content is on another domain than the main page (I have access to both pages, so code can be put in either) Also, it must resize when links in the iframe are clicked (ie when a new page within the iframe is loaded)
View 1 Replies
View Related
Jul 16, 2010
i am developing a web application in which i have to retrieve the user browser and platform information. i am using javascript to get this information and tryin to pass these values to the html hidden form element. pasting a brief code from my application.
<body>
<script>
document.mldsform.screen_width.value=screen.width;
document.mldsform.screen_height.value = screen.height;
</script>
<form id="mldsform" action="/QoEMLDS/qoe" method="post">
[Code]...
View 1 Replies
View Related
Dec 22, 2009
In Chrome, the login page on my schools educational online platform doesn't remember the login info. So i made a bookmark with this javascript injection, that fills in the info, and focusses on the 'aanmelden' button (='login' in dutch), so that i only have to press enter to continue. Here's the javascript injection:javascript: ocument.getElementById('username').value='23889493984';document.getElementById('password').value='4 42384985';return false;document.getElementById('login').focus();This works fine but i'd like to make it happen faster. I wish i could let the script be activated instantly when the page loads, so i only have to press enter, or if possible, let the script click the login button itself.
View 19 Replies
View Related
May 27, 2011
Simple question really. The cross fade option used by default with cycle is not a linear one...it looks like it uses some kind of S curve because during the crossfade animation the background (meaning the area behind the images being cross-faded) becomes visible. Example screenshot taken mid-transition. The pink should never be visible behind the grey, but it is:
[Code]...
at the moment, which is leading to background visibility. Is there another fx option I should be using?
View 4 Replies
View Related
Jan 27, 2010
I've got a div and i'm setting its height to the height of an image like so:
$('#gallery').css({height: $('#gallery a').find('img').css('height')});
how would i add 1px to this?
lets say the image is 300px, how do i set the height of my gallery div to 301px?
View 1 Replies
View Related
Jul 23, 2009
Venegal (Thx) wrote the majority of the following script and I must say , he did a great job:thumbsup:. there are a few extensions to script that are needed.
the priority within the searched user words and the found content on the site have been set to "the first found" will be hilited. e.g:
1. the wonderfull holidays
2. Sunny holidays
3. holidays in Spain
No.1 (div) only would be hilited if the user search words were e.g: "sunny holidays in Spain". I need the priority to be set so that all three divs would be hilited if the word "holidays" (for example) were searched for.
the Script:
function toggle(id, status){
document.getElementById(id).style.visibility = status;
}
function populateSearchField(){
[Code]....
View 33 Replies
View Related
Jul 23, 2005
The onload event appears to be firing before all the content of my
window loads or something. In the stripped down example below, my
browser tells me that it cannot find the object "thisThing." What
gives?
<html>
<head>
<script type="text/javascript">
window.onload = document.getElementById("thisThing").style.background =
"red";
</script>
</head>
<body>
<div id="thisThing" style="height:40px; width:50px;
background:blue">
</div>
</body>
</html>
View 3 Replies
View Related
May 19, 2011
1) Found all images on the page (img)2) Add on the top of it linkI've learned how to count all images and how to add new elements on the page. Seems like need to connect them, but I failed.
View 5 Replies
View Related
Aug 4, 2011
Code:
var testi_box = {
spread: function(num) {
var main_obj=document.getElementById('testis');
$('.bg').stop().animate({opacity:1},800);
$(main_obj).stop().animate({height: 420}, 800);
var objs=main_obj.children;
[Code]...
So, I have this object that is set to fire its method the moment a user hovers their mouse over a particular div on my page. IT works just fine in all other browsers but IE7 or below. When i look at the error in IE it says that testi_box is undefined. But clearly it is defined. So, I'm lost. Is there something that I am missing?
View 1 Replies
View Related
Sep 25, 2006
I need a regexp function which makes a match when the string contains <img...AND the img tag above dows NOT contain a certain path Here is what I have:
<imgs.*(src).+>
This matches if my string contains "<img .....src.....>" (the dots can be anything, I dont care). However, after the "src" part and before the ....
View 2 Replies
View Related
Jun 5, 2010
I have dynamic divs being added to a contianer. I create them like this [code]...
The problem is when the dynamic DIV is added to the form, it shows up but is not clickable. The event is never called. When a div is added with the class clickable on page load, the event is triggered.
Im guessing there is some way to add an element to the clickable selector but I can not figure it out.
View 1 Replies
View Related
Sep 10, 2009
Basically I have a table completely generated and appended to the DOM in javascript, I am calling:$("#tableID" + p).siblings('.child-' + "tableID").fadeOut('fast');This works fine in FF and Safari, but IE does not find the siblings. I even did an alert with:$("#tableID" + p).siblings('.child-' + "tableID").length, and as expected IE returns 0, while FF/Safari return the correct amount (2).
View 1 Replies
View Related
Aug 28, 2009
I was looking at the jquery.flash plugin and it looks like what I need to get the job done but how to do it. Here is some sample code from the plugin site
$('.custom').flash(null, null, function(htmlOptions){
// do stuff
});
Below is the code I tried using:
<script type="text/javascript">
var strToAdd = 'my text to add'
$(document).ready(function(){
$('#flashHere').flash(null, null, function (htmlOptions){
$(".hello").append(strToAdd)
});
}); // END DOCUMENT READY
</script>
In the end what I would really like to do is replace one div with one other if flash is not found, this will make an iPhone friendly version of a site with a lot of flash video on it.
View 1 Replies
View Related
May 17, 2010
I need to retrieve part of a web page pointed to by a link <a class="fetch" href='web_page_address'> ... The part I want has an id of 'unit_descr'. When I know the address beforehand and can enter it manually without fetching it, this works:
[Code]...
I suspect that $('a.fetch') selects a complete JQuery object whereas I only want the content. Given that I can get hold of the content and put it into the url-variable,I am also not sure whether it is OK to use url +' #unit_descr' to construct the argument for the load function.
View 2 Replies
View Related
Feb 18, 2010
Javascript is not recognising any of the hidden variables on this web form. It simply reports them to be null. I tried declaring a new variable without "runat=server". No luck.
<html>
When queried the value, it says "Object required" and when queried the variable, it says "null".
View 4 Replies
View Related
May 22, 2010
I have a Patient intake form which takes Patient information like FIRSTNAME, LASTNAME, DATE OF BIRTH, ADDRESS, CITY, and POSTAL CODE. When a user enters FIRSTNAME, LASTNAME and DATE OF BIRTH it should fill the rest of the fields (ADDRESS, CITY, POSTAL CODE) if I have a record in my database.
I am using JAVA with MYSQL and I pull records when a user leaves DATE OF BIRTH textbox.I don�t know weather I should store everything in a dropdown or I should have a separate form for the matched records from where the user can click the record and fill the rest of the fields.
View 4 Replies
View Related
Jun 15, 2011
I have had a report that the tabs (product description, shipping etc.) found on this page don't work:
JCDC x odm collection - UFO - Black
I have checked on quite a few browsers and it seems fine. The person who reported it appears to be using IE9 which I don't have access to.
View 1 Replies
View Related
Mar 16, 2007
I'm using firefox javascript console to find errors within my webpages.
I've found the following errors:
"Expected colour but found '#'. Error in parsing value from property 'color'. Decleration dropped. Line 0"
" Error in parsing value from property 'display'. Decleration dropped. Line 0"
How can i go about finding which lines of code are creating these errors? as it tells me its on line0, this gives me no clue as to where to look.
View 3 Replies
View Related
Sep 24, 2007
I am taking the contents of a webpage:
var body = document.body.innerHTML;
How can i scan body and if it finds:
<!-- google_ad_section_start -->
<!-- google_ad_section_end -->
the body content becomes just what's within those tags?
View 4 Replies
View Related
May 3, 2011
how I can do this....If I have an element like this...
<li
s-n
>
mytext
</li>
And a selector like this... My element is not found...
View 1 Replies
View Related
Feb 7, 2011
I'm trying to check a database of lotto numbers against 3 different values and have gotten it that to work. What I need is to give a feedback message if no match is found once the submit button is clicked.
function winCheck() {
var grandPrize = $('#grandPrize').val();
var otherPrize = $('#otherPrize').val();
var addPrize = $('#addPrize').val();
[Code]....
View 4 Replies
View Related
Aug 31, 2010
I have extremely text intensive web pages. A search engine can find the page but then my users have to search for the word using Ctrl+F. Google can highlight the found terms on the page but google does not index every page on my sites.
I need a way to highlight found words on my web pages by using an input box at the top of the page. The user will type in a word to find and the script will highlight all the found words on a page.
Here is code that is supposed to work to find an individual word but not all words. The code does not work for me.
[Code]...
View 4 Replies
View Related