Is there a function I can call to know if a certain element is currently being hovered over, like this?
/* Returns true or false */
hoveringOver("a#mylink");
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
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?
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 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+')';
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>
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
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".
<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..
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.
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?
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
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?
I have two li (points) on this page http://animactions.ca/Animactions/le_developpement_des_equipes_de_travail.php that take up two lines. I'm not sure how to properly align them so that they line up with the first line.
I'm referring to this point:
Renforcir la cohésion et l’esprit d’équipe pour un travail proactif et durable qui génère des
rendements supérieurs.
Thanks
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 want to redirect from a old url which still appears in the google search to the new one. the old url is this:
http://www.marionettecolla.org/file%20_mostra_milano/mostra_marionette-milano.htm
and I want to redirect it to the home page:
http://www.marionettecolla.org/
I used this in my .htaccess:
Redirect http://marionettecolla.org/file\ _mostra_milano/mostra_marionette-milano.htm http://marionettecolla.org/
but I am getting Error 500... Does anybody know how to solve this problem?
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 table in a fieldset that is not displayed properly (overflow) because of a long file name that I cannot wrap. Is there a way to wrap the file name that is in the table?
<table>
<tr><td>stackoverflow.com/questions/4584756/how-can-i-make-the-datagridviewtextboxcolumn-wrap-to-a-new-line-if-its-text-is-t</td></tr>
</table>
I set the width and overflow style on the element and still no help. Any other ideas?
Hello All,
How can I escape a ' (single quote) in JS. This is where I'm trying to use it.
<input type='text' id='abc' value='hel'lo'>
result for the above code is "hel" populated in the text box. I tried to replace ' with \' but this what I'm getting.
<input type='text' id='abc' value='hel\'lo'>
result for the above code is "hel\" populated in the text box.
How can I successfully escape the single quotes.
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.
I just started using google app engine. In order to use templates, I'm using jinja2.
I want to add images dynamically after I set the width and height of the img tag. I used
PIL in order to read the image size and put the one I want.
However when I open the image with PIL, I need it not to be in a static_dir
and to put the image in the img tag, I need it to be in the static_dir.
As a testing solution I've copied the folder to see if I get results and I did. But as
you can see having each image saved twice is kind of bad.
I couldn't find a similar question, that's why here it is:
Whats the best way to hide or encrypt an email link in a website, so that a crawler can't read it, but the user can nevertheless click it?
I don't want to conufse the users by typing the email like this: john (at) mail.com or similar ways. (and i think this kind of links can nevertheless read by crawlers?)
I also tried things like that:
<script>// <![CDATA[eval(unescape('%76%61%72%20%73%3D%27%61%6D%6C%69%6F%74%72%3A%62%61%40%65%64%61%6E%6F%6C%2E%69%27%3B%76%61%72%20%72%3D%27%27%3B%66%6F%72%28%76%61%72%20%69%3D%30%3B%69%3C%73%2E%6C%65%6E%67%74%68%3B%69%2B%2B%2C%69%2B%2B%29%7B%72%3D%72%2B%73%2E%73%75%62%73%74%72%69%6E%67%28%69%2B%31%2C%69%2B%32%29%2B%73%2E%73%75%62%73%74%72%69%6E%67%28%69%2C%69%2B%31%29%7D%64%6F%63%75%6D%65%6E%74%2E%77%72%69%74%65%28%27%3C%61%20%68%72%65%66%3D%22%27%2B%72%2B%27%22%3E%4F%62%65%72%70%61%72%6C%65%69%74%65%72%3C%2F%61%3E%27%29%3B'))]]></script>
but i heard this can also be read by crawler and it isn't really good practices
are ther any common approaches?
I want to have a text field where people can type in a value. Then I want to have a href open a url with the text field appended to the end.
So if the text field says "elephant" then when they click the link, a page will open with at example.com/elephant.
I think javascript would be the easiest way to accomplish this but I just don't know how.
Recently i learned that i can display images in a web page without referencing an image URL as follows :
<img class="disclosure" img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9oIGRQbOY8MjgMAAABVSURBVBjTfc6xDcAwCETRM0rt5nbA+49j70DDAqSLsGXyJQqkVxxwNOeMiEA+waW1VuT/inrvG7wikht8UETy2ygVMjO4O8YYTf6AqrZyUwYlygAAXo+QLmeF4c4uAAAAAElFTkSuQmCC">
I had another small bmp image that i wanted to display, so i opened it in vim and the img source looke like:
When i paste this code where it needs to be pasted i only get "BM?"
How to i convert/paste this code properly to be used as an image source?