PHP - :hover And Opacity Question
Im starting to learn CSS and I have the following code that make a in img background, alternated colors in a table and then has a mouseover change of colors.<style type="text/css">
th { background-color: #00F; color:#FFF; font-size: large; font-weight: bolder; font-family: Georgia, "Times New Roman", Times, serif; } tr:nth-child(even) {background-color: #6FF; opacity: .8;} tr:nth-child(odd) {background-color: #FFF; opacity: .8;} tr {text-align: center;} body {background-image: url(DiveFlagBackground.jpg);} tr:hover{background-color:#000; color:#00FF00}; </style>I have started to realize that depending where each line of code is will determine how everything run...for instance if I move my background-image line to the the top of the script...it disappears from the screen...im still working on understanding this, but that is nor here nor there right now. My issue is this...when I test this page in Chrome, everything looks how I want it. The table header section doesnt change any color, on mouseover only the table row with the table data changes color, and you can slightly see the image in the background through the table. When I test this in IE11 the opacity setting looks like it is being ignored and complete covers the whole background image. Also when I do the mouse over everything looks good except when I mouseover the table header section it changes to a slightly darker blue. It there an exclude or an "if row = th" or "if row = 0 color change = NULL" type of statement I need to put in? Not sure what to do about the opacity setting as I thought this code would work for anything past IE8. If you would like to see the issue my page is http://mouse.myds.me/Test1.php Thanks for any advise\help. Similar TutorialsI want when onmouseover on particular section to put an OPACITY #fff 0.2 layer on everything except the selected class i.e. table
Similarly as you have:
.tableHighlight:hover{background-color:#eee} <table id='table-main' class='tableHighlight'> ... but inversed (puts layer on everything else, but not the table itself) --- http://jsfiddle.net/LYcm9/1/ Visit: http://testowa.testy...e/testy-na-mocz (the behavior is going crazy). Has anybody got maybe any clue on how to fix it to work correctly?
Code itself. http://jsfiddle.net/LYcm9/5/
Basically I want to open up a png file with a transparent background which is 48x48 pixels And set the opacity of this to about 50% of the original. I have the following to do what I want but just returns an empty image On imagecolorallocatealpha i have tried setting the alpha value at different values between 0 and 127 with no success as 127 returns a black block imagecopy($menu,$image, #Positioning 0,0, 0,0, #Image size 48,48 ); #Create transparent block $new_img = imagecreatetruecolor(48, 48); imagealphablending($new_img, true); $transparent = imagecolorallocatealpha($new_img, 255, 255, 255, 0); imagefilledrectangle($new_img, 0, 0, 48, 48, $transparent); #Put block over original image imagecopy($menu,$new_img, #Positioning 0,0, 0,0, #Image size 48,48 ); The image below shows on top the original and on bottom what I am roughly trying to create Where am i going wrong? when in a form, I wish to build a conditional that if the response to a radio button is a value of 2 (female), it will display an input requesting for users maiden name. If not 2 goes to the next input statement. Here is code I was experimenting with: <html> <body> <form action="" name="test" method='POST'> <input type="radio" id="sex" value=1 checked><label>Male</label> <input type="radio" id="sex" value=2><label>Femaleale</label> <?php $result = "value"; if ($result == 2) echo "<input type='int' id='gradYear' size='3' required>"; else echo "Not a female!" ?> <input type="submit" value="GO"> </form> </body> </html> The code passes debug, however, Not a Female is displayed. My question is - Can I do this and if so, what value do I test against id='sex' or value. I tried each one but gave the same results. I realize that $_POST[sex] would be used after the submit button is clicked. But this has me stumped. Thanks for the assis in advance. I have the following menu that changes to red if each of the menu items are hovered over. This menu shows on every page of my website. I have the following problem: If a user was to click a menu item (e.g. Menu 2), the page will navigation to the page set in the a tag (i.e page2.html) If the user was to leave there mouse in the same position as it was in before the menu item was clicked (i.e. over the selected menu item), then the menu would automatically change to red again on the new page, as the jQuery hover code below will be activated. Is there a way to stop this behaviour? Ideally I want users to have to mouse off of the menu item and then on it again before the menu item changes to red if the users mouse is still over the selected menu item after clicking one of the menu links. <script type="text/javascript"> $(document).ready(function() { $('li').hover(function() { $(this).css('background', 'red'); }, function() { $(this).css('background', 'none'); }) }) </script> <ul> <li><a href="page1.html">Menu 1</a></li> <li><a href="page2.html">Menu 2</a></li> <li><a href="page3.html">Menu 3</a></li> </ul> hello all, i am having a for each problem. im trying to get two post fields using the foreach function. here is what i have in my form.php: Code: [Select] <?php foreach($_POST['staff'] as $value) { echo "$value - <br />"; } ?> the name of the the fields coming in are Code: [Select] name='staff[]' and the second one is name='descr[]' fields += 1; Hi to all people, I just want to know if there a php script I can use using DRM. The scenario, once the user download the song from a website, he/she can't forward into other using bluetooth or file transfer. It is possible to do that scenario? Thanks in advance i am looking for a way to write a php script to pull information from a html table and put that information in to the databases does any one have any idea who to do this Hello. I'm trying to pull information out of an xml file. However I'm a bit lost in getting the actual value. Code: [Select] $url="http://ws.audioscrobbler.com/2.0/?method=artist.getimages&artist=Dr%20Feelgood&limit=1&autocorrect=1&api_key=c107c9b5c09cb5693b6c19409dd984c1"; $xml = simpleXML_load_file($url,"SimpleXMLElement",LIBXML_NOCDATA); $largesquare=$xml->images->sizes->size[2]; Is what I have but its not pulling the information. The above url will give you the link to a set xml file for this example. And I want to get the info for the Code: [Select] <size name="largesquare" width="126" height="126">http://userserve-ak.last.fm/serve/126s/43173899.jpg</size> I'm sure I'm doing something wrong that's a simple fix but I am lost here. In the sizes there are 6 different size options each with different names and I have no idea how to pull the one with the correct name that I need. Thank you to who ever can help me sort this out. hi, im trying to say if field ARTIST = Eminem then do the following. here is my current code Code: [Select] $hmm = simplexml_load_file('http://localhost/1.0/?method=player.getPlayQueue'); foreach($hmm->tracks->track as $tracks) { $artist = $tracks->artist; $title = $tracks->title; $album = $tracks->album; $index = $tracks->index; $id = $tracks->id; //If we submitted the form if('.$artist.'="eminem") { echo '<table border="0" width="70%" align="center">'; echo '<tr>'; i just need to know how to do the if(***) part. thanks. U guys know in forums how at the top or bottom there links to the "1 2 3 4 5 next" and stuff? and how it loads a database? how would i do that exactly? or explain to me what it could be called. cause me i have no idea :/ I'm creating a re classified ad site and I've hit a brick wall. I'm trying to create a 'listing' which will contain info and pictures of the property that's for sale, but I'm unsure on how to do it. Would I have to create different db tables to have the albums, images and listing together? Or would can I just do it all in one table? I appreciate your help. I am trying to make it so that it will load if the site if the site is online(EG. $siteonline = 1), and so on. I can't seem to think of how I could do this so it will work from the very top of the page's html, to the very bottom. Like the following code is meant to list all of the stuff in that database. <?php $list_q = mysql_query("SELECT * FROM settings") or die (mysql_error()); while($list_f = mysql_fetch_assoc($list_q)) { } ?> I have my page laid out like this.. <?php include "includes/connect.php"; include "includes/config.php"; ?> <?php $list_q = mysql_query("SELECT * FROM settings") or die (mysql_error()); while($list_f = mysql_fetch_assoc($list_q)) { ?> Html content etc.. <?php } include 'includes/footer.php'; ?> But if I do it that way, It only displays what is in footer.php. Hi! I'm new. I'm Gabby. :3 I'm currently self teaching myself php, MySQL, and Ajax for a simulation game I'm opening up where you can breed, show, and train dogs. I've been reading tutorials on how to create a sign up page with a confirmation email being sent to you. However, I don't understand why I need multiple pages. For instance, with the tutorial I learned, you have to create three pages. One to configure and connect your site to the DB, one to display the form to sign up with, and one to display a success/failed message. My issue with that is I know it's possible using php (or is it Ajax?) to have one page. An example is on http://dogdayzz.com, when you sign up the page doesn't redirect you anywhere, it uses the same php file the entire time. Is this because the code for the form is printed in an if statement, then cleared and executed with an error/success prompt? Hopefully someone can help me out.. I couldn't find anything on google. :/ Thanks everyone for your time Gabby Hello, I have a 'strange' situtation. I have this string "Who Am I" that will be used as an header (site for a client) but the design shows that the word "Who" and the words "Am I" are in 2 different colors, in HTML this is a quick fix, but in PHP? What I was thinking was explode the string and fetch the first element put it in a var en then concat the 2 others. But what if the title is more then 3 elements after exploding? It needs to be more dynamic, but I don't know how to do it. Does anyone have an idea? Major breakthrough. utf8_encode() allows me to view utf-8 characters in the browser. Therefore, my source data file must be ISO-8859-1 encoded text, right? Am I understanding this correctly?
<?php //mb_internal_encoding("UTF-8"); header('Content-type: text/html; charset=utf-8'); $file = fopen('some_csv_file_created_by_excel.csv', "r"); ob_start(); while (($spec = fgetcsv($file, 100000, ",")) !== FALSE){ echo($spec[0].' '.utf8_encode($spec[0]).'<br>'); } $string=ob_get_clean(); ?> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>utf</title> </head> <body> <p><?php echo($string);?></p> </body> </html> Edited by NotionCommotion, 11 January 2015 - 08:22 PM. Just get started with OO in PHP. If I create an object while on one page and then call another page, can I still access that first object, or is it destroyed when the second page is called? For example, if I have on page1.php: Code: [Select] $obj = new $MyObject(); and then call page2.php, is it possible to still access $obj while on that page? So I've been trying to work with OOP more lately and basically I have just some basic code. Code: [Select] class announce_manager { //I guess we'll start with setting the title. public function setTitle($title) { $this->title = $title; } public function getTitle() { return setTitle(); } } Anyway, say I set the title on a page called announce.php would it still be set on index.php? Probably not right? Is there a way to make the value I set carry over to another page without using sessions? example: announce.php Code: [Select] if(isset($_GET['annsubmit'])) { $title = $_GET['title']; $ann = new announce_manager(); $ann->setTitle($title); } index.php Code: [Select] echo getTitle(); <- make this equal to the value I set in announce, without using sessions. I'm just asking if this is possible. Im not new to php but I am trying to think if this possible. I want to write a php script that creates a div inside a div until lets say 10 divs are created. I have been trying do while statements but them seem to place them underneth each other not within. I want <div id=one"> <div id=two"> <div id=three"> </div> </div> </div> Only thing I can create is <div id=one"></div> <div id=two"></div> <div id=three"></div> Like I said I dont even know if this is possible or if I am just retarded and can't think of a way to do it but it would be nice to see what others have to say about it. Howdy, I have a question about Dates in PHP 5.3.6. I queried my database (SQL Server 2008) and I got back two columns, a date(StartDate) and a time(StartTime). The software we used only allows the user to enter a StartDate, so that field always has a value, but there are instances where the StartTime is null (no time set). What I want to do is if there is a StartTime, concat it to the StartDate. If there is not StartTime, I want to add a default time. But when I do that, I get an error saying that I cannot combine a string and a date. I really do not understand why this is happening. I set up PHP 5.3.6 on a server, so I am not sure if there something in the php.ini file that is not allowing me or if this is something new. Some help please! Thanks Code: [Select] if( $row['StartTime'] != null ) $sTime = $row['StartDate'] . " " . $row['StartTime']; //What I want '2011-05-03 17:58:12.000' else $sTime = $row['STartDate'] . " 00:00:00.000"; //What I want '2011-05-03 00:00:000' |