Condition Depending On Screen Rs / What To Do?

May 16, 2010

I m crearting a pop with some parameters like locationbar,statusbar=no and its height and width 1280*800. but originally i have given its hight to be 699 to pixel a viewpoint.. can i put some if condition. checking if the resolution isn't at 1280 * 800 and if so than the popup should have scroll. is there anymore smater way to handle this? as of now if someone has a less Res. everything get clipped off

View 4 Replies


ADVERTISEMENT

Change Text Depending On Condition?

Mar 10, 2009

I have the following code that I use to loop though records in my database and display the text. For each record I look through the text for a certain piece of text and then split the content it is found. So for example if the database contained a field with the data "this is some text [splithere] this is some more text" then the first part (this is some text) would be displayed and then a more button would be shown. If the user clicked the more button then the rest of the content (this is some more text) would also be shown.

At the moment the more button is always shown, even if the [splithere] text was not found. What I'd like to do is only show the more button where necessary. I'd also like to change the text from 'more' to 'hide' when the button has been clicked and the additional content is being shown as when they click the link again the text is in fact hidden and so saying 'more' doesn't make any sense.

Here is the code I use code...

View 14 Replies View Related

Load CSS Depending Upon Screen Resolution

Apr 10, 2006

I'm trying to write a javascript that detects the screeen resolution size and load a css sheet accordingly. Can someone see why the below javascript does not work?

<script language="JavaScript1.2">
<!--

if (screen.width==800||screen.height==600) //if 800x600
{document.write("<link REL='stylesheet' href="../site.css" rel="stylesheet" type="text/css" />");}


else if (screen.width==640||screen.height==480) //if 640x480
{document.write("<link REL='stylesheet' HREF='http://www.mysite.com/site.css' TYPE='text/css'>");}

else if (screen.width==1024||screen.height==768) //if 1024x768
{document.write("<link REL='stylesheet' HREF='http://www.mysite.com/site.css' TYPE='text/css'>");}

else //if all else
{document.write("<link REL='stylesheet' HREF='http://www.mysite.com/site.css' TYPE='text/css'>");}

//-->
</script>

View 5 Replies View Related

Can DIV Located In The MasterPage Be Resized Depending On The Screen Resolution??

Aug 19, 2010

Can DIV located in the MasterPage be resized depending on the screen resolution?

<tr style="vertical-align: top;"><td>
<div id="mainArea">
<asp:contentplaceholder id="ContentPlaceHolder1" runat="server" />
</div></td></tr>

I've tried unsuccessfully -

var height = screen.height;
var area1 = document.getElementById('ctl00_mainArea');
if (height == 1024) {[code].....

View 6 Replies View Related

Better Screen.width Or Screen.availWidth

Mar 5, 2007

Same thing for the height parameter; for to set in the centre some popup with images what is better? what are the difference?

View 6 Replies View Related

Get The Screen Size Of The Current Screen In IE?

Mar 2, 2011

I have 2 monitors from a different size. It is important in my application that I get the screen size of the monitor where the webbrowser is located. When I try to get the screen size (window.screen.height + window.screen.width) only IE gives me always the screen size of the main monitor where my taskbar (windows7) is located, instead of the screen size of the secondary screen where the webbrowser is located.

View 6 Replies View Related

Condition Insertion

Jul 23, 2005

Is it possible to make a file insertion conditional? I now have the code:

'<script type="text/javascript" src="http://www.site.com/showit.js">'

And I wondered if it is possible to make this conditional, something like:
if (mycondition==true) include('http://www.site.com/showit.js');

View 4 Replies View Related

Get A Value If A Condition Is Filled

Jul 23, 2005

if (form.interface_template.options.length > 0) {
template =
form.interface_template.options[form.interface_template.selectedIndex].value

} else {
template = ''
}

View 4 Replies View Related

If / Then / Else Help Needed - More Then One Condition Possible?

Sep 19, 2006

I want to write an if / then statement and have tried using this:

var MyVarMailto;
if (Request.Form("LoanRequest") == "Under $250,000") {
if (Request.Form("Organization") == "1") {
MyVarMailto = "emailA@address.com";
}
}
else if (Request.Form("LoanRequest") == "Over $250,000") {
if (Request.Form("Organization") == "1") {
MyVarMailto = "emailB@address.com";
}
}
else {
MyVarMailto = "emailC@address.com";
}

So basically I have a form that gets filled out and submitted which
passes the values to this page. I want to check the values against
conditions that you can probably figure out above and then set the
variable contigent to those values. I tried using AND after the first
condition but that doesn't do anything.

View 14 Replies View Related

Put If Condition In Function ?

Apr 26, 2011

I have an table in which an select box like this:

Following have an option in OS: windows/Linux. i only want when user select OS - linux ... then function call otherwise if user select OS - window ... no need to call this function validate() i think it requires if condition in function Validate().... how it is posible to put if condition in function validate()

View 1 Replies View Related

How To Add 1 Condition To Script.?

Nov 30, 2006

Currently have a txt input with default value="Your Name". with the on focus event to clear default text.

However if a user doesn't touch the txt box the the script goes on to validate the email box below because we have "Your Name" loaded up. and that passes validation below.

How do I go about adding another condition to look for string "Your Name" to the following if statement.

I tried adding another "||" statement after value.length <2 part and got nowhere.

function checkmailform(){
if ( (document.forms.newsletterform.Name.value == null) || (document.forms.newsletterform.Name.value.length < 2) ) {alert("Input First NewsName");
document.forms.newsletterform.Name.focus();
return false;
}else{...

View 4 Replies View Related

Elseif Condition?

Apr 27, 2002

Is there a way in javascript to use multiple if conditions? For example I need something like this: Code:

if( email=="" )
{
do something
}
elseif( !issemail(email) )
{
do something else
}

I know it would be possible to use else and then another if but since this javascript code is PHP-generated and I'd have about 5 conditions, I can't really do this easily.

View 10 Replies View Related

XMLHttpRequest() Completion Condition?

Dec 12, 2005

I came across something I'm unfamiliar with -- there's an added check for window.location.href.indexOf("http")==-1 to see if the XMLHttpRequest send() completed, i.e.,

if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))

Does anyone know why this is done or which browser this (kludge?) is meant for?

View 3 Replies View Related

Reating Checkboxes With Condition.

Nov 7, 2006

I created two forms. In the first frame i had Items with checkbox like
names of students etc. When ever i checked on any name It's display on
the other frame. Up to know it's fine. But when i deselcted any check
box it again display same name.

My requirement is when i deselected the checkbox that particular
student name is deleted from the list .

View 6 Replies View Related

JQuery :: Use OR Condition For Validation?

Jan 5, 2012

I am using jquery.validate.js for validating the forms.

The issue now is I have a dropdown list with values. Say a dropdown has the values 'One', 'two', 'Three', 'Four','Five'.

If the value is 'Three' OR 'Four' . The next 2 input fields are required. Else those are not required. The value will be seperated with optgroups.

I tried with different options but I couldnt find the solution. How to validate this?[code]...

View 1 Replies View Related

JQuery :: If Condition Is Not Working

Aug 10, 2011

Here is my code

[Code]

But if Condition is not working...

View 2 Replies View Related

Two Not Equal Comparisons In An OR Condition?

Nov 5, 2009

Could anyone tell me (or link me to some place that can) why the following if-statement will execute?

if (5!=6 || 7!=8) {
alert("Why does this work?");
}

View 2 Replies View Related

Condition And Element.style...?

Aug 17, 2007

i am trying to have text-decoration applied on some text depending on the value of certain variable. If the value of myvar=0 text-deco =none and if it's 1 then text deco= line-trough...

Kind of the same thing that emails web apps like yahoo or gmail do with mails read or unread if it's unread then email title/subject is bold/strong but if it's read then email title is in normal font-weight...

here is some piece of code i have written to do that

the text on which i want to apply the conditionnal decoration is a table cell (cell2DisplayCell1), the text itself is inserted by the innerHTML instruction!

I tried to introduce the conditional statement with a function displaylinksLineThrough() which is defined in the second block code... Code:

View 2 Replies View Related

Global Variable Only If A Condition Is Met

Aug 2, 2010

I wish to declare a global variable, but only if a certain condition is met. For example:

Code:

Except that now it is not global because it is contained within an if statement.

View 3 Replies View Related

JQuery :: Animate Onto Screen Works, But Animate Off Screen Happens Instantaneously?

Dec 27, 2011

I have a div that has a negative top margin and a negative right margin. The right margin is because I want to have the div slide onto the page from the right. The top margin is because without it my page height is the height of the visible elements plus the height of the off-screen div.On a button click, I move the div down and then animate it onto the screen from the right. On button click again, I animate the div to the right, off the screen, and then move it up. I also toggle its width & padding so it will appear to grow/shrink as it moves on/off screen. At least that's what I am trying to do. The animation onto the screen looks good, but going off the screen, it appears to happen intantaneously, instead of animatedDoes anyone know how I can fix this?

$(".addPanels").live("click", function(){//now and in the future, show the add panels menu
var thisAddPanelsMenu = $(this).parent().prev(".addPanelsMenu");//get the addPanelsMenu
if(thisAddPanelsMenu.length) {//if the addPanelsMenu exists

[code]....

View 2 Replies View Related

JQuery :: Code Always Going Into Error Condition

Jul 7, 2011

Following is the code.

On click event it always goes into errorfunctionwith status "undefined".

View 2 Replies View Related

JQuery :: Combine Selectors With && Condition?

Jul 27, 2010

Is there a way to combine selectors with && condition. eg: $('.classname div[att=value]') Requirement is to select all div elements with class 'classname' and (&&)an attribute 'att' whose value is 'value'

View 2 Replies View Related

JQuery :: Add A Class Based On Certain Condition?

Feb 10, 2010

How could I add a class to a div that contains a div that contains a link that contains specific text, and name that class based on that link but with hyphens in place of spaces and all lower case? Here's specifically what I'm looking for:

<div class="my-div-one">
h2>Title of this section</h2>
<div class="my-div-something-else"><a href="url">My Special Link</a></div>
</div>

In the above example, I want to add the class my-special-link to my-div-one. Is that possible? How could I do that?

View 1 Replies View Related

If Statement / Condition Being Accepted Even If False

Feb 22, 2011

In the attached code the outcome always defaults to the first test, even if the condition is false. How would I alter the syntax so that both condtions are evalauted?

View 2 Replies View Related

Change Font Colour On Condition

Oct 1, 2009

I have 3 sum fields which I want to change to a red colour if the value is > or < 100. Apparently this is a DAP, but I am using javascript to tweek some of the settings in DAP.

View 7 Replies View Related

If Statement / Not Responding To False Condition

Feb 22, 2011

In the attached code the outcome always defaults to the first test, even if the condition is false. How would I alter the syntax so that both condtions are evalauted?

View 10 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved