What's wrong here? The alert function was working until I added this new function to it.
Is there anything I am doing wrong? It just simply doesn't fire the alert anymore.
<input value="1" type="checkbox" name="salgsvilkar" id="checkbox2" style="float:left;"
/>
{literal}
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
$(function() {
//checkbox
$("#scrollwrap").click(function(){
$("#scrollwrap").toggleClass('highlight');
});?
});
$(function(){
//button
$("#fullfor_btn").click(function(e){
if(!$("#checkbox2").is(':checked') == false)
{
alert("Please accept the terms of sale.");
e.preventDefault();
}
});
});
</script>
{/literal}
<button type="submit" class="submit" name="{$method}" id="fullfor_btn" title="Fullfør bestillingen nå" value=""> </button>
I've noticed a small alignment issue in the three major browsers when rendering my web site. As such how can I perform the following pseudo-code with pure CSS?
if Webkit (Safari/Chrome) {
#myDIV {margin-top:-3px}
} else if (Firefox) {
#myDIV {margin-top:0px}
} else { // IE and other browsers
#myDIV {margin-top:1px}
}
I have a script that links to the server I am hosting (IP can change) usually I would just use for links:
var url ='http://' + window.location.hostname + 'end of url';
But in this case it isnt appearing to be so easy.
I have tried: (1)
$('#scriptid').attr('src', url);
as well as: (2)
var script = document.createElement( 'script' );
script.type = 'text/javascript';
script.src = url;
$("#insert").append( script );
Now case (2) works loads the script runs the script. But when at the end of my script it hits the 'write data' it decides to replace the entire page with just the data.
Any idea on how I can do this?
I'm using pointer-events:none; on the main photograph at the top of my site http://www.onedirection.net/, to allow the user to select the navigation behind the image.
However, I'd like to let the user click on each member of the band to go to a separate page, but ONLY for the parts of the image that don't overlap into the navigation.
I'm a bit stuck with this. Can it be done? I was thinking of using an image map, but can't get it working without the navigation becoming "less clickable".
I have a black background div of a size which contains an image.
<div id="Banner">
<img onclick="expand();" src="hola.jpg">
</div>
#Banner {
position:relative;
height:50px;
width:50px;
margin:0 auto;
background-color:#000000;
-webkit-transition: all 0.5s ease-in-out 0.5s;
-moz-transition: all 0.5s ease-in-out 0.5s;
-o-transition: all 0.5s ease-in-out 0.5s;
transition: all 0.5s ease-in-out 0.5s;
}
<script type="text/javascript">
function expand(){
document.getElementById('Banner').style['height'] = '250';
document.getElementById('Banner').style['width'] = '250';
}
</script>
So when the user clicks on the image, the div transitions to 250, 250.
My problem is that, i want it to to transition to full screen. The following javascript
function does expand to fullscreen but the transition effect doesn't come. I need to do it from a javascript code without jquery.
function expand(){
document.getElementById('Banner').style['position'] = 'absolute';
document.getElementById('Banner').style['height'] = '100%';
document.getElementById('Banner').style['width'] = '100%';
document.getElementById('Banner').style['top'] = '0';
document.getElementById('Banner').style['left'] = '0';
}
Please advice.
Update : Solution
Roger below has provided with an alternative solution. This takes care if the document
has already been scrolled and is another place. Will expand the div to full browser screen.
sz=getSize(); //function returns screen width and height in pixels
currentWidth=200;
currentHeight=200;
scalex=sz.W/currentWidth;
scaley=sz.H/currentHeight;
transx=0-((expandingDiv.offsetLeft+(currentWidth/2))-(sz.W/2))+document.body.scrollLeft;
transy=0-((expandingDiv.offsetTop+(cuttentHeight/2))-(sz.H/2))+document.body.scrollTop;
transx = transx.toString();
transy = transy.toString();
document.getElementById("Banner").style['-webkit-transform'] = 'translate('+transx+'px,'+transy+'px) scale('+scalex+','+scaley+')';
I know that I can assign an onclick action to <input type="button"-style buttons. But is it possible to let it behave like an <a> without using JavaScript? I ask because I'm in a situation where technically I'm better off using <a>'s, but buttons look nicer.
For example I have:
<div id ="test">[the content here]</div>
The content within the div tags will appear after I called the id of div using ajax.
This is the code:
function dinamic(add)
{
var kode = add.value;
if (!kode) return;
xmlhttp2.open('get', '../template/get_id.php?kode='+kode, true);
xmlhttp2.onreadystatechange = function() {
if ((xmlhttp2.readyState == 4) && (xmlhttp2.status == 200))
{
var add = document.getElementById("test");
add.innerHTML = xmlhttp2.responseText;
}
return false;
}
xmlhttp2.send(null);
}
So it will appear <div id="test">A</div>
I'd like to put the content of div - A into mysql query.
$test = $_GET['test'];
$query = "select * from example where category='$test'";
I've tried to make variable $test of the div id to get the content but result of the query in category is none.
I tried again, I put the div in to the query
$query = "select * from example where category='<div id=\"test\">A</div>'";
Yes, It works. But when I did query on navicat, no results I got because there's spaces between A that is <div> and </div>.
How to remove/hide the div tags only so its only appear the content?
> $query = "select * from example where category='A'"; <
Edit:
If I echo the query on firefox browser will say "$query = "select * from example where category='[space]A[space]'";"
And look at the bug(I use firebug), it will say "$query = "select * from example where category='<div id="test">A</div>'";"
So my guessing why can't get result after query on navicat is there's spaces between A([space]A[space]), just have no idea how to remove/hide the div tags, I want to get this result only "$query = "select * from example where category='A'";"
Thanks.
I have two fields which calculate a total, but I have a radio button pair that determines a variable within the equation. Here's the radio button code:
<input type="radio" name="estimate_pool_shape" value="1" /> Angle
<input type="radio" name="estimate_pool_shape" value=".86392" /> Freeform
Immediately after that, this JavaScript is then calculating the surface area of the pool based of these fields and script:
(Length <input type="text" size="5" name="estimate_pool_length"
onBlur="conv2inches(document.forms.mainform);" />) x
(Width <input type="text" name="estimate_pool_width" size="5"
onBlur="conv2inches(document.forms.mainform);" />)
The following JavaScript already works to update the fields, I just need the variable it uses to set the field values to change based on the radio buttons.
function conv2inches(mainform) {
var oin;
var oinches;
if(isNaN(mainform.estimate_pool_width.value)||isNaN(mainform.estimate_pool_length.value)){
alert("Please enter numbers only");
return false;
}
oin = ((mainform.estimate_pool_width.value) + (mainform.estimate_pool_length.value) * %%%RADIO BUTTON VARIABLE HERE%%%);
oinches = (oin);
if(oinches==0){
alert("Please enter valid values into the boxes");
}
mainform.estimate_pool_sqft.value = oinches;
return false;
}
The Extjs API site adds a new tab for each search you do.
The tabs each have a red X on them to close the tab similar to what browsers have.
Check it out here:
I'd like to replicate this and it seems like something that would be built-in to the API, but cannot find it.
Any ideas?
Hello,
we have an web-application built in flash (it's actually just getting built :D) where is very important to be notified, when user closes his window.
Since it's in flash, we do not worry about Javascript, we do not support non-javascript users.
What is the safest (meaning it's 100% sure it gets called) X-browser way to call php script to close session, make some db changes, etc.?
Thank you
I'm beginning to think this is impossible, but thought I'd ask you guys.
Basically it's a 2 column layout, but the "business" wants the following:
-Always take up the entire browser window
-Accommodate resizing of browser window
-Left column will be fixed width, but that width should be flexible from page-to-page.
-Left column has a region at the top with fixed height.
-Left column has a bottom region. It should take up the remaining vertical space of browser window. If content is very large, it will have a scroll bar just for that region.
-Right column should take up remaining horizontal space of browser window.
-Right column has a region at the top with fixed height.
-Right column has a bottom region. It should take up the remaining vertical space of browser window. If content is very large, it will have a scroll bar just for that region.
I've tried everything...divs, floated, absolutely positioned, tables, divs in tables...
Is this even possible?
Here's an image of what it should look like:
http://imgur.com/zk1jP.png
Hi,
I have style applied to the TD elements of the dataTable of my myfaces application.
td.financialReportTd {
font-family: Arial;
font-size: 12px;
line-height: 12px;
color:black;
background-color: white;
padding-right: 5px;
text-align: right;
border:0px black solid;
height: 30px;
padding-top:4px;
padding-left:4px;
vertical-align: top;
direction: rtl;
}
Output:
<td class="financialReportTd">
MY TEXT
</td>
No matter what I try, those NBSP tags fill up the TD and position of the text changes to the worse.
I tried style text-align:right; (I need RTL text), I tried direction: rtl; Nothing helps.
How can I align my text to the very right of the TD and avoid those space tags?
In this form code what is the role of name="" attribute?
name="s" and name="submit".
Is it necessary to add?
<form action="/index.php" method="get">
<fieldset>
<legend>Search</legend>
<label for="s"><span>Search WaSP</span>
<input value="" name="s" id="s"></label>
<input type="submit" value="Go!" name="submit" >
</fieldset>
</form>
Quite a while ago i was more in websites building then i am now.
In my time there where huge debates about what to use; tables or pure CSS alternatives.
I went out of the webdesigning, but now an old question re-surfaces.
What i would like to create is a web page design that depending on screensize, would self organize the page into columns, so that for example on a PDA it would show 1 column
On an old computer monitor, it would show 2 colomns, and on a widescreen laptop it would show 3 columns. I forgot how this was called and how it was done in the past, it had to do with XML and storing data seperate from design (if i remember well), perhaps these days better methods exist to do that, does this, anyone ring this a bell ?
Also i note a lot is possible with Jquery and and brouwser depending webkits.
But i need to make sure that it would run on all (modern) brouwsers : Iexplorer, Firefox, chrome
And Jquery is nice too, but i am kinda woried that some day one of these brouwser vendors decides that jscript like java isnt enabled by default (or is that very unlikely ?)11
Perhaps someone can point me to a method that is the prefered way to do this.
like this
in my design both side of div has border like this and content in div can be increased or decreased . and in any condition both side top and bottom should be blur like this.
How to make this possible
Hi,
I am looking for a regular expression that can convert my font tags (only with size and colour attributes) into span tags with the relevant inline css. This will be done in VB.NET if that helps at all.
I also need a regular expression to go the other way as well.
To elaborate below is an example of the conversion I am looking for:
<font size="10">some text</font>
To then become:
<span style="font-size:10px;">some text</span>
So converting the tag and putting a "px" at the end of whatever the font size is (I don't need to change/convert the font size, just stick px at the end).
The regular expression needs to cope with a font tag that only has a size attribute, only a color attribute, or both:
<font size="10">some text</font>
<font color="#000000">some text</font>
<font size="10" color="#000000">some text</font>
<font color="#000000" size="10">some text</font>
I also need another regular expression to do the opposite conversion. So for example:
<span style="font-size:10px;">some text</span>
Will become:
<font size="10">some text</font>
As before converting the tag but this time removing the "px", I don't need to worry about changing the font size.
Again this will also need to cope with the size styling, font styling, and a combination of both:
<span style="font-size:10px;">some text</span>
<span style="color:#000000;">some text</span>
<span style="font-size:10px; color:#000000;">some text</span>
<span style="color:#000000; font-size:10px;">some text</span>
I apprecitate this is a lot to ask, I am hopeless with regular expressions and need to find a way of making these conversions in my code. Thanks so much to anyone that can/is willing to help me!
I have a htm page in my disk (C:\pages\page1.htm).
This page link CSS and gif (C:\pages\img\img1.gif, c:\pages\css\css1.css).
How can I generate MHT file ?? Only using C# .NET managed.
Hi,
My question is simple: is there a way to animate the maximize of ExtJS windows? Currently my windows just maximize without any animation and it looks "boring".
I'm creating a newsletter, and i want to have panels that change background-color on mouse over.
Seeing as the newsletter wont have a head, I am defining all styles inline. I'm pretty sure most popular mail clients will block JS. So I was wondering if I can define a hover effect in the style attribute. Or is there any other solution to achieve this effect?
Peace
<form enctype="multipart/form-data" method="post" action="mailto:[email protected]" accept-charset="UTF-8">
Is there a problem if mails are sent this way .. i wanna avoid using PHP codes..
i have the following simple script
<input class="input" type="text" name="password" style="color: #797272;"
value= "<?php if ($_POST[password] != '') {echo '';}
else {echo '????????';}?>"
onclick="if (this.value === this.defaultValue) {
this.value='';
this.style.color='black';
this.type='password';
}"
/>
it works fine, but in IE7 it doesn't change the input type.
this.type='password'; doesn't work
could you help me? thanks
I have some code:
- count = 0
- @clients.each do |client|
%div{:class => "grid_2#{(" alpha" if (count % 3) == 0) || (" omega push_2" if (count % 3) == 2) || " push_1"}"}= link_to h(client.name), client
- count += 1
I want to output an opening div tag right after the each statement if the (count % 3) == 0 and out put the end tag at the end of the block if the (count % 3) == 2 but I can't figure out how to get HAML to do this. Any ideas?