Search Results

Search found 5382 results on 216 pages for 'href'.

Page 16/216 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • Why am I losing my characters from my html string when trying to add html dynamically using javascri

    - by Hamman359
    I have a page that I am trying to dynamically add some links to. The links are getting added to the page fine, but the '[' and ']' at either end of the line are getting dropped. The code from my .js file is: var html = "[ <a href='#'>Change</a>&nbsp;|&nbsp;<a href='#'>Remove </a> ]"; $(html).appendTo("#id123"); The result I want is: [ <a href='#'>Change</a>&nbsp;|&nbsp;<a href='#'>Remove</a> ] The result I'm getting is: <a href='#'>Change</a>&nbsp;|&nbsp;<a href='#'>Remove</a> If I wrap the line in a <span> tag like so: var html = "<span>[ <a href='#'>Change</a>&nbsp;|&nbsp;<a href='#'>Remove </a> ]</span>"; $(html).appendTo("#id123"); it renders as expected. I set a breakpoint on the code and checked the html var right before the .appendTo and it contains the '[' and ']'. Anyone know why this is happening? Are '[' and ']' special character that need escaped and I'm just forgetting that fact?

    Read the article

  • How to select LI exept first and second ?

    - by Wazdesign
    Here is the structure of the content , I want to select all LI except the first two ( ie no-link) jQuery(document).ready(function(){ var nosubnav = jQuery('.first-level li:not(:has(ul))'); var nosubnavsize = jQuery('.first-level li:not(:has(ul))').size(); jQuery(nosubnav).css('border' , '1px solid red'); alert('List item which does not have submenu '+nosubnavsize); }); div class="navigation-container"> <ul class="first-level"> <li><a href="#">No Link</a></li> <li><a href="#">No Link</a></li> <li><a href="#">Link 1</a></li> <li><a href="#">Link 2</a> <ul> <li><a href="#">Link2.1</a></li> <li><a href="#">Link2.2</a> <ul> <li><a href="#">Link 2.2.1</a></li> </ul> </li> </ul> </li> <li><a href="#">Link </a></li> </ul> </div> related Question : http://stackoverflow.com/questions/2771801/how-to-count-li-which-does-not-have-ul

    Read the article

  • function not printing out anything

    - by Abdul Latif
    I have the following function below: public function setupHead($title){ $displayHead .='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>'.$title.'</title>'; $displayHead .='<script type="text/javascript" src="'.PATH.'js/jquery-1.3.2.min.js"></script> <script type="text/javascript" src="'.PATH.'js/thickbox.js"></script> <script type="text/javascript" src="'.PATH.'js/ui.core.js"></script> <!--<script type="text/javascript" src="'.PATH.'js/js.js"></script>--> <link rel="stylesheet" href="'.PATH.'css/thickbox.css" type="text/css" media="screen" /> <link rel="stylesheet" type="text/css" href="'.PATH.'css/styles.css"> <link rel="stylesheet" type="text/css" href="'.PATH.'css/menu_allbrowsers.css"> <link rel="stylesheet" href="'.PATH.'css/news.css" type="text/css" media="screen" /> <link rel="stylesheet" href="'.PATH.'css/text.css" type="text/css" media="screen" /> <script type="text/javascript" src="'.PATH.'js/swfobject.js"></script> <!--[if IE 7]><link rel="stylesheet" type="text/css" href="'.PATH.'css/IE7menu.css" /><![endif]--> <!--[if IE 6]><link rel="stylesheet" type="text/css" href="'.PATH.'css/ie6.css" /><![endif]--> <!--[if IE 7]><link rel="stylesheet" type="text/css" href="'.PATH.'css/ie7.css" /><![endif]--> </head>'; return $displayHead; } but when it call is using: echo classname->setupHead($title); nothing gets displayed. doesn't php allow html in strings? Thanks in advance

    Read the article

  • How to select LI except first and second ?

    - by Wazdesign
    Here is the structure of the content, I want to select all LI except the first two (ie no-link) jQuery(document).ready(function(){ var nosubnav = jQuery('.first-level li:not(:has(ul))'); var nosubnavsize = jQuery('.first-level li:not(:has(ul))').size(); jQuery(nosubnav).css('border' , '1px solid red'); alert('List item which does not have submenu '+nosubnavsize); }); div class="navigation-container"> <ul class="first-level"> <li><a href="#">No Link</a></li> <li><a href="#">No Link</a></li> <li><a href="#">Link 1</a></li> <li><a href="#">Link 2</a> <ul> <li><a href="#">Link2.1</a></li> <li><a href="#">Link2.2</a> <ul> <li><a href="#">Link 2.2.1</a></li> </ul> </li> </ul> </li> <li><a href="#">Link </a></li> </ul> </div> related Question : http://stackoverflow.com/questions/2771801/how-to-count-li-which-does-not-have-ul

    Read the article

  • jQuery: Main nav items selected depending on URL or page name

    - by Ricardo
    Ok, I've looked all over for a solution for this but so far I'm unable to find anything related to what I need to accomplish. What I need is very simple as far as logic goes. I have a nav bar like this one: <nav> <ul> <li><a href="download.shtml">Download</a></li> <li><a href="documentation.shtml">Documentation</a></li> <li><a href="contact.shtml">Contact</a></li> <li><a href="about.shtml">About</a></li> </ul> </nav> And the URLs of the site are straightforward: http://domain.net/download.shtml http://domain.net/documentation.shtml http://domain.net/contact.shtml http://domain.net/about.shtml Question: How can I detect which page/URL I'm on and add a class of .active to the corresponding nav item? The end result would be, for example if I'm in the Download page: <nav> <ul> <li><a href="download.shtml" class="active">Download</a></li> <li><a href="documentation.shtml">Documentation</a></li> <li><a href="contact.shtml">Contact</a></li> <li><a href="about.shtml">About</a></li> </ul> </nav> Thanks in advance for any help on this matter.

    Read the article

  • Anchors with overlapping divs

    - by tmdelane
    I am using a grid based layout, with two main sections. Graph and Timeline. Graph, contains graded vertical bars, HTML similar to: <div id="graph" class="container_160"> <div id="Jan-97" class="grid_1 major"><a href="#">&nbsp;</a></div> <div id="Feb-97" class="grid_1 minor"><a href="#">&nbsp;</a></div> <div id="Mar-97" class="grid_1 minor"><a href="#">&nbsp;</a></div> <div id="Apr-97" class="grid_1 minor"><a href="#">&nbsp;</a></div> <div id="May-97" class="grid_1 minor"><a href="#">&nbsp;</a></div> etc... </div> Timeline, contains horizontal bars, HTML similar to: <div id="timeline" class="container_160"> <div id="bar1" class="grid_32 suffix_128"><a href="#">&nbsp;</a></div> <div id="bar2" class="prefix_32 grid_24 suffix_104"><a href="#">&nbsp;</a></div> <div id="bar3" class="prefix_58 grid_7 suffix_95"><a href="#">&nbsp;</a></div> </div> Timeline is relatively positioned to Graph so that it overlaps. My problem is that when these divs overlap, the anchors in Timeline stop working. I am open to both CSS and Jquery solutions. Thanks in advance. t.

    Read the article

  • [jQuery UI - Accordion] Styling active header?

    - by RC
    Hi, Simple issue: I am using Accordion without any UI themes (just barebones, using my own CSS). So far, so good, except that I cannot figure out how to set an "active" style for the currently selected header. The jQuery code: $("#menu").accordion({ event:"mouseover",header:"a.top" }); The HTML code: <a href="#" class="top">XXX1</a> <div class="sub"> <a href="#">Subheading 1</a> <a href="#">Subheading 2</a> <a href="#">Subheading 3</a> </div> <a href="#" class="top">XXX2</a> <div class="sub"> <a href="#">Subheading 1</a> <a href="#">Subheading 2</a> <a href="#">Subheading 3</a> </div> This works great, except that I cannot find a way to define the styles for the active header without using ThemeRoller. Manually setting the following styles in my CSS has no effect: .ui-state-active .ui-widget-content .ui-state-active .ui-state-active a .ui-state-active a:link .ui-state-active a:visited Assistance, please?

    Read the article

  • How can I load an external jQuery gallery/slideshow into a div

    - by DanTransformer
    Ive got a jQuery navigation menu loading external content into my #main div, which works fine when the content is static, but the site im working on contains jQuery galleries/slideshows which id like to call into the div. The problem im having is when the gallery is loaded, the images all appear but the jQuery functionality does not work. Any help appreciated. here is the javascript im using... $(document).ready(function() { // Check for hash value in URL var hash = window.location.hash.substr(1); var href = $('#accordion ul li a').each(function(){ var href = $(this).attr('href'); if(hash==href.substr(0,href.length-5)){ var toLoad = hash+'.html #main'; $('#main').load(toLoad) } }); $('#accordion ul li a').click(function(){ var toLoad = $(this).attr('href')+' #main'; $('#main').hide('fast',loadContent); $('#load').remove(); $('#wrapper').append('<span id="load">LOADING...</span>'); $('#load').fadeIn('normal'); window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-5); function loadContent() { $('#main').load(toLoad,'',showNewContent()) } function showNewContent() { $('#main').show('normal',hideLoader()); } function hideLoader() { $('#load').fadeOut('normal'); } return false; }); });

    Read the article

  • CSS Positioning Issues: Wordpress

    - by cam
    I'm following this tutorial here http://www.kriesi.at/archives/create-a-multilevel-dropdown-menu-with-css-and-improve-it-via-jquery on adding a menu with jquery. I've created my menu, but I'm having trouble adding it to wordpress. I opened up the header.php file since I want it to appear below the banner, and I paste it in it's own div, but it always "pushes" everything below it to the right. How do I stop it from doing this? Here's the code: <ul id="nav"> <li><a href="#">1 HTML</a></li> <li><a href="#">2 CSS</a></li> <li><a href="#">3 Javascript</a> <ul> <li><a href="#">3.1 jQuery</a> <ul> <li><a href="#">3.1.1 Download</a></li> <li><a href="#">3.1.2 Tutorial</a></li> </ul> </li> <li><a href="#">3.2 Mootools</a></li> <li><a href="#">3.3 Prototype</a></li> </ul> </li>

    Read the article

  • Regular expression, how to find all tags A which do not contain tag IMG inside it?

    - by Kirzilla
    Hello, Let's suppose that we have such HTML code. We need to get all <a href=""></a> tags which DO NOT contain img tag inside it. <a href="http://domain1.com"><span>Here is link</span></a> <a href="http://domain2.com" title="">Hello</a> <a href="http://domain3.com" title=""><img src="" /></a> <a href="http://domain4" title=""> I'm the image <img src="" /> yeah</a> I'm using this regular expression to find out all links preg_match_all("!<a[^>]+href=\"?'?([^ \"'>]+)\"?'?[^>]*>(.*?)</a>!is", $content, $out); I can modify it preg_match_all("!<a[^>]+href=\"?'?([^ \"'>]+)\"?'?[^>]*>([^<>]+?)</a>!is", $content, $out); But how can I tell to exclude results containing <img substring inside of <a href=""></a>? Thank you

    Read the article

  • Regex to remove all but file name from links

    - by Moasely
    Hi, I am trying to write a regexp that removes file paths from links and images. href="path/path/file" to href="file" href="/file" to href="file" src="/path/file" to src="file" and so on... I thought that I had it working, but it messes up if there are two paths in the string it is working on. I think my expression is too greedy. It finds the very last file in the entire string. This is my code that shows the expression messing up on the test input: <script type="text/javascript" src="/javascripts/jquery.js"></script> <script type="text/javascript"> $(document).ready(function(){ var s = '<a href="one/keepthis"><img src="/one/two/keep.this"></a>'; var t = s.replace(/(src|href)=("|').*\/(.*)\2/gi,"$1=$2$3$2"); alert(t); }); </script> It gives the output: <a href="keep.this"></a> The correct output should be: <a href="keepthis"><img src="keep.this"></a> Thanks for any tips!

    Read the article

  • PHP use of undefined constant error

    - by user272899
    Using a great script to grab details from imdb, I would like to thank Fabian Beiner. Just one error i have encountered with it is: Use of undefined constant sys_get_temp_dir assumed 'sys_get_temp_dir' in '/path/to/directory' on line 49 This is the complete script <?php /** * IMDB PHP Parser * * This class can be used to retrieve data from IMDB.com with PHP. This script will fail once in * a while, when IMDB changes *anything* on their HTML. Guys, it's time to provide an API! * * @link http://fabian-beiner.de * @copyright 2010 Fabian Beiner * @author Fabian Beiner (mail [AT] fabian-beiner [DOT] de) * @license MIT License * * @version 4.1 (February 1st, 2010) * */ class IMDB { private $_sHeader = null; private $_sSource = null; private $_sUrl = null; private $_sId = null; public $_bFound = false; private $_oCookie = '/tmp/imdb-grabber-fb.tmp'; const IMDB_CAST = '#<a href="/name/(\w+)/" onclick="\(new Image\(\)\)\.src=\'/rg/castlist/position-(\d|\d\d)/images/b\.gif\?link=/name/(\w+)/\';">(.*)</a>#Ui'; const IMDB_COUNTRY = '#<a href="/Sections/Countries/(\w+)/">#Ui'; const IMDB_DIRECTOR = '#<a href="/name/(\w+)/" onclick="\(new Image\(\)\)\.src=\'/rg/directorlist/position-(\d|\d\d)/images/b.gif\?link=name/(\w+)/\';">(.*)</a><br/>#Ui'; const IMDB_GENRE = '#<a href="/Sections/Genres/(\w+|\w+\-\w+)/">(\w+|\w+\-\w+)</a>#Ui'; const IMDB_MPAA = '#<h5><a href="/mpaa">MPAA</a>:</h5>\s*<div class="info-content">\s*(.*)\s*</div>#Ui'; const IMDB_PLOT = '#<h5>Plot:</h5>\s*<div class="info-content">\s*(.*)\s*<a#Ui'; const IMDB_POSTER = '#<a name="poster" href="(.*)" title="(.*)"><img border="0" alt="(.*)" title="(.*)" src="(.*)" /></a>#Ui'; const IMDB_RATING = '#<b>(\d\.\d/10)</b>#Ui'; const IMDB_RELEASE_DATE = '#<h5>Release Date:</h5>\s*\s*<div class="info-content">\s*(.*) \((.*)\)#Ui'; const IMDB_RUNTIME = '#<h5>Runtime:</h5>\s*<div class="info-content">\s*(.*)\s*</div>#Ui'; const IMDB_SEARCH = '#<b>Media from&nbsp;<a href="/title/tt(\d+)/"#i'; const IMDB_TAGLINE = '#<h5>Tagline:</h5>\s*<div class="info-content">\s*(.*)\s*</div>#Ui'; const IMDB_TITLE = '#<title>(.*) \((.*)\)</title>#Ui'; const IMDB_URL = '#http://(.*\.|.*)imdb.com/(t|T)itle(\?|/)(..\d+)#i'; const IMDB_VOTES = '#&nbsp;&nbsp;<a href="ratings" class="tn15more">(.*) votes</a>#Ui'; const IMDB_WRITER = '#<a href="/name/(\w+)/" onclick="\(new Image\(\)\)\.src=\'/rg/writerlist/position-(\d|\d\d)/images/b\.gif\?link=name/(\w+)/\';">(.*)</a>#Ui'; const IMDB_REDIRECT = '#Location: (.*)#'; /** * Public constructor. * * @param string $sSearch */ public function __construct($sSearch) { if (function_exists(sys_get_temp_dir)) { $this->_oCookie = tempnam(sys_get_temp_dir(), 'imdb'); } $sUrl = $this->findUrl($sSearch); if ($sUrl) { $bFetch = $this->fetchUrl($this->_sUrl); $this->_bFound = true; } } /** * Little REGEX helper. * * @param string $sRegex * @param string $sContent * @param int $iIndex; */ private function getMatch($sRegex, $sContent, $iIndex = 1) { preg_match($sRegex, $sContent, $aMatches); if ($iIndex > count($aMatches)) return; if ($iIndex == null) { return $aMatches; } return $aMatches[(int)$iIndex]; } /** * Little REGEX helper, I should find one that works for both... ;/ * * @param string $sRegex * @param int $iIndex; */ private function getMatches($sRegex, $iIndex = null) { preg_match_all($sRegex, $this->_sSource, $aMatches); if ((int)$iIndex) return $aMatches[$iIndex]; return $aMatches; } /** * Save an image. * * @param string $sUrl */ private function saveImage($sUrl) { $sUrl = trim($sUrl); $bolDir = false; if (!is_dir(getcwd() . '/posters')) { if (mkdir(getcwd() . '/posters', 0777)) { $bolDir = true; } } $sFilename = getcwd() . '/posters/' . preg_replace("#[^0-9]#", "", basename($sUrl)) . '.jpg'; if (file_exists($sFilename)) { return 'posters/' . basename($sFilename); } if (is_dir(getcwd() . '/posters') OR $bolDir) { if (function_exists('curl_init')) { $oCurl = curl_init($sUrl); curl_setopt_array($oCurl, array ( CURLOPT_VERBOSE => 0, CURLOPT_HEADER => 0, CURLOPT_RETURNTRANSFER => 1, CURLOPT_TIMEOUT => 5, CURLOPT_CONNECTTIMEOUT => 5, CURLOPT_REFERER => $sUrl, CURLOPT_BINARYTRANSFER => 1)); $sOutput = curl_exec($oCurl); curl_close($oCurl); $oFile = fopen($sFilename, 'x'); fwrite($oFile, $sOutput); fclose($oFile); return 'posters/' . basename($sFilename); } else { $oImg = imagecreatefromjpeg($sUrl); imagejpeg($oImg, $sFilename); return 'posters/' . basename($sFilename); } return false; } return false; } /** * Find a valid Url out of the passed argument. * * @param string $sSearch */ private function findUrl($sSearch) { $sSearch = trim($sSearch); if ($aUrl = $this->getMatch(self::IMDB_URL, $sSearch, 4)) { $this->_sId = 'tt' . preg_replace('[^0-9]', '', $aUrl); $this->_sUrl = 'http://www.imdb.com/title/' . $this->_sId .'/'; return true; } else { $sTemp = 'http://www.imdb.com/find?s=all&q=' . str_replace(' ', '+', $sSearch) . '&x=0&y=0'; $bFetch = $this->fetchUrl($sTemp); if( $this->isRedirect() ) { return true; } else if ($bFetch) { if ($strMatch = $this->getMatch(self::IMDB_SEARCH, $this->_sSource)) { $this->_sUrl = 'http://www.imdb.com/title/tt' . $strMatch . '/'; unset($this->_sSource); return true; } } } return false; } /** * Find if result is redirected directly to exact movie. */ private function isRedirect() { if ($strMatch = $this->getMatch(self::IMDB_REDIRECT, $this->_sHeader)) { $this->_sUrl = $strMatch; unset($this->_sSource); unset($this->_sHeader); return true; } return false; } /** * Fetch data from given Url. * Uses cURL if installed, otherwise falls back to file_get_contents. * * @param string $sUrl * @param int $iTimeout; */ private function fetchUrl($sUrl, $iTimeout = 15) { $sUrl = trim($sUrl); if (function_exists('curl_init')) { $oCurl = curl_init($sUrl); curl_setopt_array($oCurl, array ( CURLOPT_VERBOSE => 0, CURLOPT_HEADER => 1, CURLOPT_FRESH_CONNECT => true, CURLOPT_RETURNTRANSFER => 1, CURLOPT_TIMEOUT => (int)$iTimeout, CURLOPT_CONNECTTIMEOUT => (int)$iTimeout, CURLOPT_REFERER => $sUrl, CURLOPT_FOLLOWLOCATION => 0, CURLOPT_COOKIEFILE => $this->_oCookie, CURLOPT_COOKIEJAR => $this->_oCookie, CURLOPT_USERAGENT => 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6' )); $sOutput = curl_exec($oCurl); if ($sOutput === false) { return false; } $aInfo = curl_getinfo($oCurl); if ($aInfo['http_code'] != 200 && $aInfo['http_code'] != 302) { return false; } $sTmpHeader = strpos($sOutput, "\r\n\r\n"); $this->_sHeader = substr($sOutput, 0, $sTmpHeader); $this->_sSource = str_replace("\n", '', substr($sOutput, $sTmpHeader+1)); curl_close($oCurl); return true; } else { $sOutput = @file_get_contents($sUrl, 0); if (strpos($http_response_header[0], '200') === false){ return false; } $this->_sSource = str_replace("\n", '', (string)$sOutput); return true; } return false; } /** * Returns the cast. */ public function getCast($iOutput = null, $bMore = true) { if ($this->_sSource) { $sReturned = $this->getMatches(self::IMDB_CAST, 4); if (is_array($sReturned)) { if ($iOutput) { foreach ($sReturned as $i => $sName) { if ($i >= $iOutput) break; $sReturn[] = $sName; } return implode(' / ', $sReturn) . (($bMore) ? '&hellip;' : ''); } return implode(' / ', $sReturned); } return $sReturned; } return 'n/A'; } /** * Returns the cast as links. */ public function getCastAsUrl($iOutput = null, $bMore = true) { if ($this->_sSource) { $sReturned1 = $this->getMatches(self::IMDB_CAST, 4); $sReturned2 = $this->getMatches(self::IMDB_CAST, 3); if (is_array($sReturned1)) { if ($iOutput) { foreach ($sReturned1 as $i => $sName) { if ($i >= $iOutput) break; $aReturn[] = '<a href="http://www.imdb.com/name/' . $sReturned2[$i] . '/">' . $sName . '</a>';; } return implode(' / ', $aReturn) . (($bMore) ? '&hellip;' : ''); } return implode(' / ', $sReturned); } return '<a href="http://www.imdb.com/name/' . $sReturned2 . '/">' . $sReturned1 . '</a>';; } return 'n/A'; } /** * Returns the countr(y|ies). */ public function getCountry() { if ($this->_sSource) { $sReturned = $this->getMatches(self::IMDB_COUNTRY, 1); if (is_array($sReturned)) { return implode(' / ', $sReturned); } return $sReturned; } return 'n/A'; } /** * Returns the countr(y|ies) as link(s). */ public function getCountryAsUrl() { if ($this->_sSource) { $sReturned = $this->getMatches(self::IMDB_COUNTRY, 1); if (is_array($sReturned)) { foreach ($sReturned as $sCountry) { $aReturn[] = '<a href="http://www.imdb.com/Sections/Countries/' . $sCountry . '/">' . $sCountry . '</a>'; } return implode(' / ', $aReturn); } return '<a href="http://www.imdb.com/Sections/Countries/' . $sReturned . '/">' . $sReturned . '</a>'; } return 'n/A'; } /** * Returns the director(s). */ public function getDirector() { if ($this->_sSource) { $sReturned = $this->getMatches(self::IMDB_DIRECTOR, 4); if (is_array($sReturned)) { return implode(' / ', $sReturned); } return $sReturned; } return 'n/A'; } /** * Returns the director(s) as link(s). */ public function getDirectorAsUrl() { if ($this->_sSource) { $sReturned1 = $this->getMatches(self::IMDB_DIRECTOR, 4); $sReturned2 = $this->getMatches(self::IMDB_DIRECTOR, 1); if (is_array($sReturned1)) { foreach ($sReturned1 as $i => $sDirector) { $aReturn[] = '<a href="http://www.imdb.com/name/' . $sReturned2[$i] . '/">' . $sDirector . '</a>'; } return implode(' / ', $aReturn); } return '<a href="http://www.imdb.com/name/' . $sReturned2 . '/">' . $sReturned1 . '</a>'; } return 'n/A'; } /** * Returns the genre(s). */ public function getGenre() { if ($this->_sSource) { $sReturned = $this->getMatches(self::IMDB_GENRE, 1); if (is_array($sReturned)) { return implode(' / ', $sReturned); } return $sReturned; } return 'n/A'; } /** * Returns the genre(s) as link(s). */ public function getGenreAsUrl() { if ($this->_sSource) { $sReturned = $this->getMatches(self::IMDB_GENRE, 1); if (is_array($sReturned)) { foreach ($sReturned as $i => $sGenre) { $aReturn[] = '<a href="http://www.imdb.com/Sections/Genres/' . $sGenre . '/">' . $sGenre . '</a>'; } return implode(' / ', $aReturn); } return '<a href="http://www.imdb.com/Sections/Genres/' . $sReturned . '/">' . $sReturned . '</a>'; } return 'n/A'; } /** * Returns the mpaa. */ public function getMpaa() { if ($this->_sSource) { return implode('' , $this->getMatches(self::IMDB_MPAA, 1)); } return 'n/A'; } /** * Returns the plot. */ public function getPlot() { if ($this->_sSource) { return implode('' , $this->getMatches(self::IMDB_PLOT, 1)); } return 'n/A'; } /** * Download the poster, cache it and return the local path to the image. */ public function getPoster() { if ($this->_sSource) { if ($sPoster = $this->saveImage(implode("", $this->getMatches(self::IMDB_POSTER, 5)), 'poster.jpg')) { return $sPoster; } return implode('', $this->getMatches(self::IMDB_POSTER, 5)); } return 'n/A'; } /** * Returns the rating. */ public function getRating() { if ($this->_sSource) { return implode('', $this->getMatches(self::IMDB_RATING, 1)); } return 'n/A'; } /** * Returns the release date. */ public function getReleaseDate() { if ($this->_sSource) { return implode('', $this->getMatches(self::IMDB_RELEASE_DATE, 1)); } return 'n/A'; } /** * Returns the runtime of the current movie. */ public function getRuntime() { if ($this->_sSource) { return implode('', $this->getMatches(self::IMDB_RUNTIME, 1)); } return 'n/A'; } /** * Returns the tagline. */ public function getTagline() { if ($this->_sSource) { return implode('', $this->getMatches(self::IMDB_TAGLINE, 1)); } return 'n/A'; } /** * Get the release date of the current movie. */ public function getTitle() { if ($this->_sSource) { return implode('', $this->getMatches(self::IMDB_TITLE, 1)); } return 'n/A'; } /** * Returns the url. */ public function getUrl() { return $this->_sUrl; } /** * Get the votes of the current movie. */ public function getVotes() { if ($this->_sSource) { return implode('', $this->getMatches(self::IMDB_VOTES, 1)); } return 'n/A'; } /** * Get the year of the current movie. */ public function getYear() { if ($this->_sSource) { return implode('', $this->getMatches(self::IMDB_TITLE, 2)); } return 'n/A'; } /** * Returns the writer(s). */ public function getWriter() { if ($this->_sSource) { $sReturned = $this->getMatches(self::IMDB_WRITER, 4); if (is_array($sReturned)) { return implode(' / ', $sReturned); } return $sReturned; } return 'n/A'; } /** * Returns the writer(s) as link(s). */ public function getWriterAsUrl() { if ($this->_sSource) { $sReturned1 = $this->getMatches(self::IMDB_WRITER, 4); $sReturned2 = $this->getMatches(self::IMDB_WRITER, 1); if (is_array($sReturned1)) { foreach ($sReturned1 as $i => $sWriter) { $aReturn[] = '<a href="http://www.imdb.com/name/' . $sReturned2[$i] . '/">' . $sWriter . '</a>'; } return implode(' / ', $aReturn); } return '<a href="http://www.imdb.com/name/' . $sReturned2 . '/">' . $sReturned1 . '</a>'; } return 'n/A'; } } ?>

    Read the article

  • GalleryView Jquery

    - by kwek-kwek
    I am trying to implement this JqueryGallery to my website(big gray box). Now my problem is that the images doesn't appear. here is my header code: <link href="css/galleryview.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script> <script type="text/javascript" src="js/jquery.easing.1.3.js"></script> <script type="text/javascript" src="js/jquery.galleryview-2.1.1.js"></script> <script type="text/javascript" src="js/jquery.timers-1.2.js"></script> <script type="text/javascript"> $(document).ready(function(){ $('#photos').galleryView({ panel_width: 655, panel_height: 336, transition_speed: 1500, transition_interval: 5000, nav_theme: 'dark', border: '1px solid white', pause_on_hover: true, }); }); </script> Here is my gallery code: <div id="photos" class="galleryview"> <div class="panel"> <img src="http://spaceforaname.com/img/gallery/01.jpg" /> <div class="panel-overlay"> <h2>Effet du soleil sur le paysage</h2> <p>Photo by <a href="http://www.sxc.hu/profile/tomharry" target="_blank">tomharry</a>. View full-size photo <a href="http://www.sxc.hu/photo/158829" target="_blank">here</a>.</p> </div> </div> <div class="panel"> <img src="http://spaceforaname.com/img/gallery/02.jpg" /> <div class="panel-overlay"> <h2>Eden</h2> <p>Photo by <a href="http://www.sxc.hu/profile/emsago" target="_blank">emsago</a>. View full-size photo <a href="http://www.sxc.hu/photo/152865" target="_blank">here</a>.</p> </div> </div> <div class="panel"> <img src="http://spaceforaname.com/img/gallery/03.jpg" /> <div class="panel-overlay"> <h2>Snail on the Corn</h2> <p>Photo by <a href="http://www.sxc.hu/profile/baines" target="_blank">baines</a>. View full-size photo <a href="http://www.sxc.hu/photo/34453" target="_blank">here</a>.</p> </div> </div> <div class="panel"> <img src="http://spaceforaname.com/img/gallery/04.jpg" /> <div class="panel-overlay"> <h2>Flowers</h2> <p>Photo by <a href="http://www.sxc.hu/profile/jazza" target="_blank">jazza</a>. View full-size photo <a href="http://www.sxc.hu/photo/990169" target="_blank">here</a>.</p> </div> </div> <div class="panel"> <img src="http://spaceforaname.com/img/gallery/06.jpg" /> <div class="panel-overlay"> <h2>Alone Beach 2B</h2> <p>Photo by <a href="http://www.sxc.hu/profile/sgursozlu" target="_blank">sgursozlu</a>. View full-size photo <a href="http://www.sxc.hu/photo/738279" target="_blank">here</a>.</p> </div> </div> </div>

    Read the article

  • Why are these divs not aligned and space between?

    - by acidzombie24
    Why isnt everything aligned? No yellow should be visible and no orange should be visible except for the right side and bottom left where theres space for another image. Basically my images are pretty much aligned to the center (i have other pics not in this example which is easier to see). However in this case when i have 150px height image the 150 width seems start lower. Also why are there spaces in between <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"><head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>ldfk;sd</title> <style type="text/css"> div.ImgGallery { max-width: 630px; background: orange; } .ImgGallery div { display: inline; } /* http://www.brunildo.org/test/img_center.html */ .ImgGallery div div { display: table-cell; text-align: center; background: gray; width: 150px; height: 150px; } .ImgGallery div{ background: yellow; vertical-align: middle; } //.ImgGallery div div :nth-child(2n+1) { background: red; } .ImgGallery * { vertical-align: middle; } .ImgGallery a { display: block; } .ImgGallery a * { border-style: none; } </style> </head> <div class="smallGallery"> <div class="ImgGallery"> <div><div><a href="http://google.com"><img src="a.jpg" alt="a.jpg"></a></div></div> <div><div><a href="http://google.com"><img src="a.jpg" alt="a.jpg"></a></div></div> <div><div><a href="http://google.com"><img src="a.jpg" alt="a.jpg"></a></div></div> <div><div><a href="http://google.com"><img src="a.jpg" alt="a.jpg"></a></div></div> <div><div><a href="http://google.com"><img src="a.jpg" alt="a.jpg"></a></div></div> <div><div><a href="http://google.com"><img src="b.jpg" alt="a.jpg"></a></div></div> <div><div><a href="http://google.com"><img src="a.jpg" alt="a.jpg"></a></div></div> <div><div><a href="http://google.com"><img src="a.jpg" alt="a.jpg"></a></div></div> <div><div><a href="http://google.com"><img src="b.jpg" alt="a.jpg"></a></div></div> <div><div><a href="http://google.com"><img src="a.jpg" alt="a.jpg"></a></div></div> <div><div><a href="http://google.com"><img src="a.jpg" alt="a.jpg"></a></div></div> </div></div> </body></html>

    Read the article

  • jquery intercept

    - by zurna
    In another question's discussion, I became aware of intercepting clicks and updating area without refreshing the whole page. Problem is, the following code seems correct to me and I dont receive any errors but data taken from another page is not displayed at all. Please advise. main page $('ul.thumbs li.pagination a').live('click', function() { var pageNumber = parseInt($(this).text().replace(/[^0-9]/g, '')); $(function ViewImages() { $.ajax({ type: "GET", url: "/FLPM/cp/images.cs.asp?Process=ViewImages&PAGEID=" + pageNumber, success: function(data) { $("#ViewImages").html(data); }, error: function (XMLHttpRequest, textStatus, errorThrown) { $("#ViewImages").html('.'); } }); }); return false; }); <div id="ViewImages"> </div> page where data lays <ul class="thumbs"> <li> <a href="#" class="thumb"><img src="/FLPM/media/news/images/5P2B4K5M_sm.jpg" alt="Forest Flowers" class="floatLeft" /></a> <br /> <a href="?Process=DeleteImage&IMAGEID=21" class="thumb"><span class="floatLeft">DELETE</span></a> </li> <li> <a href="#" class="thumb"><img src="/FLPM/media/news/images/6Z3L5U6W_sm.jpg" alt="Forest" class="floatLeft" /></a> <br /> <a href="?Process=DeleteImage&IMAGEID=20" class="thumb"><span class="floatLeft">DELETE</span></a> </li> <li> <a href="#" class="thumb"><img src="/FLPM/media/news/images/8O5A7J8M_sm.jpg" alt="Dock" class="floatLeft" /></a> <br /> <a href="?Process=DeleteImage&IMAGEID=19" class="thumb"><span class="floatLeft">DELETE</span></a> </li> <li> <a href="#" class="thumb"><img src="/FLPM/media/news/images/9Q6B3Q4S_sm.jpg" alt="Desert Landscape" class="floatLeft" /></a> <br /> <a href="?Process=DeleteImage&IMAGEID=18" class="thumb"><span class="floatLeft">DELETE</span></a> </li> <li> <a href="#" class="thumb"><img src="/FLPM/media/news/images/5B2N4W5Z_sm.jpg" alt="Creek" class="floatLeft" /></a> <br /> <a href="?Process=DeleteImage&IMAGEID=17" class="thumb"><span class="floatLeft">DELETE</span></a> </li> <li class="pagination">1.&nbsp;</li> <li class="pagination"><a href="2">2.</a>&nbsp;</li> </ul>

    Read the article

  • help fixing pagination class

    - by michael
    here is my pagination class. the data in the construct is just an another class that does db queries and other stuff. the problem that i am having is that i cant seem to get the data output to match the pagination printing and i cant seem to get the mysql_fetch_assoc() to query the data and print it out. i get this error: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /phpdev/pagination/index.php on line 215 i know that can mean that the query isnt correct for it to fetch the data but i have entered it correctly. sorry for the script being a little long. i thank all in advance for any help. <?php include_once("class.db.php"); mysql_connect("host","login","password"); mysql_select_db("iadcart"); class Pagination { var $adjacents; var $limit; var $param; var $mPage; var $query; var $qData; var $printData; protected $db; function __construct() { $this->db = new MysqlDB; } function show() { $result = $this->db->query($this->query); $totalPages = $this->db->num_rows($result); $limit = $this->limit; /* ------------------------------------- Set Page ------------------------------------- */ if(isset($_GET['page'])) { $page = intval($_GET['page']); $start = ($page - 1) * $limit; } else { $start = 0; } /* ------------------------------------- Set Page Vars ------------------------------------- */ if($page == 0) { $page = 1; } $prev = $page - 1; $next = $page + 1; $lastPage = ceil($totalPages/$limit); $lpm1 = $lastPage - 1; $adjacents = $this->adjacents; $mPage = $this->mPage; //the magic $this->qData = $this->query . " LIMIT $start, $limit"; $this->printData = $this->db->query($this->qData); /* ------------------------------------- Draw Pagination Object ------------------------------------- */ $pagination = ""; if($lastPage > 1) { $pagination .= "<div class='pagination'>"; } /* ------------------------------------- Previous Link ------------------------------------- */ if($page > 1) { $pagination .= "<li><a href='$mPage?page=$prev'> previous </a></li>"; } else { $pagination .= "<li class='previous-off'> previous </li>"; } /* ------------------------------------- Page Numbers (not enough pages - just display active page) ------------------------------------- */ if($lastPage < 7 + ($adjacents * 2)) { for($counter = 1; $counter <= $lastPage; $counter++) { if($counter == $page) { $pagination .= "<li class='active'>$counter</li>"; } else { $pagination .= "<li><a href='$mPage?page=$counter'>$counter</a></li>"; } } } /* ------------------------------------- Page Numbers (enough pages to paginate) ------------------------------------- */ elseif($lastPage > 5 + ($adjacents * 2)) { //close to beginning; only hide later pages if($page < 1 + ($adjacents * 2)) { for ($counter = 1; $counter < 4 + ($adjacents * 2); $counter++) { if ($counter == $page) { $pagination.= "<li class='active'>$counter</li>"; } else { $pagination.= "<li><a href='$mPage?page=$counter'>$counter</a></li>"; } } $pagination.= "..."; $pagination.= "<li><a href='$mPage?page=$lpm1'>$lpm1</a></li>"; $pagination.= "<li><a href='$mPage?page=$lastPage'>$lastPage</a></li>"; } elseif($lastPage - ($adjacents * 2) > $page && $page > ($adjacents * 2)) { $pagination.= "<li><a href='$mPage?page=1'>1</a></li>"; $pagination.= "<li><a href='$mPage?page=2'>2</a></li>"; $pagination.= "..."; for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++) { if ($counter == $page) { $pagination.= "<li class='active'>$counter</li>"; } else { $pagination.= "<li><a href='$mPage?page=$counter'>$counter</a></li>"; } } $pagination.= "..."; $pagination.= "<li><a href='$mPage?page=$lpm1'>$lpm1</a></li>"; $pagination.= "<li><a href='$mPage?page=$lastPage'>$lastPage</a></li>"; } else { $pagination.= "<li><a href='$mPage?page=1'>1</a></li>"; $pagination.= "</li><a href='$mPage?page=2'>2</a></li>"; $pagination.= "..."; for ($counter = $lastPage - (2 + ($adjacents * 2)); $counter <= $lastPage; $counter++) { if ($counter == $page) { $pagination.= "<li class='active'>$counter</li>"; } else { $pagination.= "<li><a href='$mPage?page=$counter'>$counter</a></li>"; } } } } /* ------------------------------------- Next Link ------------------------------------- */ if ($page < $counter - 1) { $pagination.= "<li><a href='$mPage?page=$next'> Next </a></li>"; } else { $pagination.= "<li class='next-off'> Next </li>"; $pagination.= "</div>"; } print $pagination; } } ?> <html> <head> </head> <body> <table style="width:800px;"> <?php mysql_connect("localhost","root","games818"); mysql_select_db("iadcart"); $pagination = new pagination; $pagination->adjacents = 3; $pagination->limit = 10; $pagination->param = $_GET['page']; $pagination->mPage = "index.php"; $pagination->query = "select * from tbl_products where pVisible = 'yes'"; while($row = mysql_fetch_assoc($pagination->printData)) { print $row['pName']; } ?> </table> <br/><br/> <?php $pagination->show(); ?> </body> </html>

    Read the article

  • How to fix a Sticky Footer that works, but after a browser window is resized, the footer overlaps.

    - by UXdesigner
    Good day, I've been trying to build a perfect footer who sticks at the bottom of the browser window after it's content. And I got help here @ Stack Overflow previously. But after a while, and doing a few tests, found out that after the browser window is resized, and then I scroll down , the footer overlaps...it is causing me a big headache right now and I'd like to fix this so I can move on. I'm going to post the display.css right here: @charset "utf-8"; body, html { margin: 0; padding: 0; text-align: center; position: relative; min-height:100%; /* needed for footer positioning*/ height:100%; /* needed for footer positioning*/ } .spacer { clear: both; height: 0; margin: 0; padding: 0; font-size: 0.1em; } .spacer_left { clear: left; margin: 0 0 10px 0; padding: 0; font-size: 0.1em; } hr { height: 1px; margin: 20px 0 20px 0; border: 0; color: #ccc; background: #ccc; } #container { position:relative; /* needed for footer positioning*/ min-height: 100%;/* needed for footer positioning*/ height: auto !important;/* needed for footer positioning*/ height: 100%;/* needed for footer positioning*/ margin: 0 auto -30px;/* needed for footer positioning*/ width: 1160px; padding: 0; border: 1px solid #333; text-align: left; } #header { margin: 0; padding: 5px; height:70px; } #login { font-family: Arial; font-size: 15px; color:#FFF; text-align: right; width: 440px; margin: 2px; } #login .theInput { font-family: Arial; font-size: 14px; width: 110px; margin-right: 5px; } #login .theSubmit { font-family: Arial; font-size: 10px; background-color: #333333; color: #FFFFFF; margin-right: 5px; } h1#lineainvisible { width:1160px; height:4px; position:relative; margin-top:4px; visibility: inherit; font-family:Arial, Helvetica, sans-serif; font-size:12px; } ul#nav { width:100%; height:36px; display:block; background-color:#000; background-repeat:repeat-x; } #wrapthatbanner { display:block; float:left; width:100%; height:524px; margin-bottom:20px; } #content { margin: 0px 20px 30px 20px; /* needed for footer positioning*/ } .panelsreadmore { margin-right: 10px; text-align:right; } div#content.columns { margin-left: 100px; } #content abbr, #content acronym { cursor: help; border-bottom: 1px dotted; } #content ul { list-style-type: square; margin-left: 75px; } #content ul li, #content ol li { margin: 0 0 0.4em 0; padding: 0; } #content blockquote { width: 75%; margin: 0 auto; padding: 20px; } #contentLeft { float: left; width:580px; } #contentRight { float: right; width:580px; } .sitenote { display:block; padding:6px; border:1px solid #bae2f0; background:#e3f4f9; line-height:130%; font-size:13px; margin-top: 0; margin-right: 0; margin-bottom: 0.5em; margin-left: 0; } #footer, .push /* needed for footer positioning*/ { padding: 5px; clear: both; position:absolute;/* needed for footer positioning*/ bottom:0;/* needed for footer positioning*/ height: -30px;/* needed for footer positioning*/ width:1150px; } And this is the HTML Template File. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <!-- TemplateBeginEditable name="doctitle" --> <title>Title of Page</title> <!-- TemplateEndEditable --> <!-- TemplateParam name="categoria" type="text" value="home" --> <!-- Meta Tags --> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- Meta Tags - Close --> <!-- CSS Loader - StartsS --> <link href="../css/main-client.css" rel="stylesheet" type="text/css" media="all" /> <!-- CSS Loader - Ends --> <!-- Drop Down Menu --> <link href="../css/dropdown.css" media="screen" rel="stylesheet" type="text/css" /> <link href="../css/default.advanced.css" media="screen" rel="stylesheet" type="text/css" /> <!-- Drop Down Menu - Ends --> <!-- Font Replacement Starts --> <script src="../cufon-yui.js" type="text/javascript"></script> <script src="../AFB_400.font.js" type="text/javascript"></script> <script type="text/javascript"> Cufon.replace('h2'); </script> <script type="text/javascript"> Cufon.replace('h3'); </script> <script type="text/javascript"> Cufon.replace('h4'); </script> <!-- Font Replacement = END --> <!-- Start VisualLightBox.com HEAD section --> <link rel="stylesheet" href="engine/css/vlightbox.css" type="text/css" /> <style type="text/css">#vlightbox a#vlb{display:none}</style> <link rel="stylesheet" href="engine/css/visuallightbox.css" type="text/css" media="screen" /> <script src="engine/js/jquery.min.js" type="text/javascript"></script> <!-- End VisualLightBox.com HEAD section --> <!-- TemplateBeginEditable name="head" --> <!-- TemplateEndEditable --> </head> <body id="@@(categoria)@@"> <div id="container"> <div id="header"> <table width="100%" border="0"> <tr> <td width="67%" height="77px;"><a href="index.html"><img src="../images/Titulos/5.png" alt="" width="257" hspace="10" vspace="10" border="0" id="screen_logo" title=""/></a></td> <td width="33%" valign="top"><form id="login">Log in: <input type="text" class="theInput" name="user" /> <input type="submit" name="Submit" value="Submit" /> </form> </td> </tr> </table> </div> <!-- Aqui es donde empieza fisicamente el menu drop down --> <ul id="nav" class="dropdown dropdown-horizontal"> <li><a href="../index.html">Home</a></li> <li><a href="#" class="dir">Service 1</a></li> <li><a href="#" class="dir">Service 2</a></li> <li><a href="#" class="dir">Service 3</a></li> <li><a href="#" class="dir">Service 4</a></li> <li><a href="#" class="dir">Service 5</a></li> <li><a href="#" class="dir">Service 6</a></li> </ul> <!-- Aqui termina el menu CSS--> <!-- Reset --> <div id="wmfg"> </div> <!-- Reset --> <!-- TemplateBeginEditable name="banner-grande" --> <!-- TemplateEndEditable --> <div id="content"><!-- TemplateBeginEditable name="content" --> <p>&nbsp;</p> <!-- TemplateEndEditable --></div> <div id="footer"><a href="../terms.html">Terms and Conditions</a> |<a href="privacy.html"> Privacy Policy</a><br/> Copyright 2010. .</div> </div> </div> </body> </html> Can somebody take a look at this, and tell me what am I doing wrong ? Thanks in advance.

    Read the article

  • CSS Attribute Content Selector multiple declarations

    - by Dave
    I have this in my CSS: div#headwrap ul li a[href*="dev"] {background: #034769}; div#headwrap ul li a[href*="music"] {background: #A61300}; div#headwrap ul li a[href*="opinion"] {background: #b2d81e}; div#headwrap ul li a[href*="work"] {background: #ffc340}; So, my expected behavior is that where a link (a) within a list item (li) inside a unordered list (ul) inside a div with id "headwrap" has an href that contains "dev", the link will have a background color of #034769. If the link has an href that contains "music" it will have a background color of #A61300, and so on. However, what I am seeing is that the rule is only correctly applied to "dev". If I reorder the CSS declarations (putting music first, for instance), it only gets applied to "music". I'm testing in Firefox and Chrome, both are doing the same thing. Only the first one is applied. Anyone have any ideas why?

    Read the article

  • Insert <div> outside every three <li>

    - by ignaty
    Hello. I have something like this: function cat_filter() { $.ajax({ type: "POST", url: 'json/cat_filter.aspx', data: "catId=" + "&styleId=" + "&colourId=" + "&sizeId=" + "&minPrice=" + "&maxPrice=", dataType: "json", beforeSend: function () { //load loading cursor }, success: function (data) { var CatItems = ""; for (var x = 0; x < data.PRODUCTS.length; x++) { CatItems += '<li class="jcarousel-item jcarousel-item-horizontal jcarousel-item-' + [x] + ' jcarousel-item-' + [x] + '-horizontal jcarousel-item-placeholder jcarousel-item-placeholder-horizontal"><a class="large_image" href="#"><img src="' + data.PRODUCTS[x].product_img + '" alt="' + data.PRODUCTS[x].product_name + '"></a><h3 class="geo_17_darkbrown">' + data.PRODUCTS[x].product_name + '</h3>'; if (data.PRODUCTS[x].product_onsale == 1) { CatItems += '<img alt="sale" src="assets/images/sale.gif" class="sale"><span class="geo_17_red_linethr">&pound;' + data.PRODUCTS[x].product_retailprice + '</span>&nbsp;&nbsp;<span class="price geo_17_darkbrown">&pound;' + data.PRODUCTS[x].product_webprice + '</span>'; } else { CatItems += '<span class="price geo_17_darkbrown">&pound;' + data.PRODUCTS[x].product_webprice + '</span>'; } if (data.PRODUCTS[x].product_COLOURS) { CatItems += '<span class="colour">'; for (var y = 0; y < data.PRODUCTS[x].product_COLOURS.length; y++) { CatItems += '<span><a href="' + data.PRODUCTS[x].product_COLOURS[y].colours_large + '"><img src="' + data.PRODUCTS[x].product_COLOURS[y].colours_thumb + '" alt="' + data.PRODUCTS[x].product_COLOURS[y].colour_name + '" /></a></span>'; } CatItems += '</span>'; } CatItems += '</li>'; } $('.carousel_00 ul').html(CatItems); }, complete: function () { //remove loading cursor } }); } This code generates this html: <div class="carousel_00"> <ul> <li><a href="#" class="large_image"><img src="assets/images/dress1.gif" alt="image"></a> <h3 class="geo_17_darkbrown">Rachel Dress</h3> <span class="price geo_17_darkbrown">&pound;89.99</span> <span class="colour"> <span><a href="assets/images/big_image_1.gif"><img src="assets/images/black.gif" alt="balck"></a></span> <span><img src="assets/images/brown.gif" alt="brown"></span> <span><img src="assets/images/purple.gif" alt="purple"></span> </span> </li> <li><a href="#"><img src="assets/images/dress2.gif" alt="image"></a> <h3 class="geo_17_darkbrown">Rachel Dress</h3> <span class="price geo_17_darkbrown">&pound;89.99</span> </li> <li><img class="sale" src="assets/images/sale.gif" alt="sale" /><a href="#"><img src="assets/images/dress3.gif" alt="image"></a> <h3 class="geo_17_darkbrown">Rachel Dress</h3> <span class="geo_17_red_linethr">&pound;99.99</span>&nbsp;&nbsp;<span class="price geo_17_darkbrown">&pound;89.99</span> </li> <li><a href="#"><img src="assets/images/dress1.gif" alt="image"></a> <h3 class="geo_17_darkbrown">Rachel Dress</h3> <span class="price geo_17_darkbrown">&pound;59.99</span> </li> <li><a href="#"><img src="assets/images/dress2.gif" alt="image"></a> <h3 class="geo_17_darkbrown">Rachel Dress</h3> <span class="price geo_17_darkbrown">&pound;89.99</span> </li> <li><a href="#"><img src="assets/images/dress3.gif" alt="image"></a> <h3 class="geo_17_darkbrown">Rachel Dress</h3> <span class="price geo_17_darkbrown">&pound;89.99</span> </li> <li><a href="#"><img src="assets/images/dress1.gif" alt="image"></a> <h3 class="geo_17_darkbrown">Rachel Dress</h3> <span class="price geo_17_darkbrown">&pound;89.99</span> </li> <li><a href="#"><img src="assets/images/dress2.gif" alt="image"></a> <h3 class="geo_17_darkbrown">Rachel Dress</h3> <span class="price geo_17_darkbrown">&pound;89.99</span> </li> <li><a href="#"><img src="assets/images/dress3.gif" alt="image"></a> <h3 class="geo_17_darkbrown">Rachel Dress</h3> <span class="price geo_17_darkbrown">&pound;89.99</span> </li> </ul></div> What I need is that every 3 li's will be in div /div. I know that this is not semantic and not right, but this is only for example. (Basically if I will figure put how to do this, I will replace li's on spans and that div that i need outside li's on li). Will be very glad if someone will help me. Because code that I have is already too much for me.

    Read the article

  • Why is my "Page [0]" not centered in my webpage?

    - by William
    My "Page [0]" text isn't centered on my webpage. Anyone know why? I could really use some help please. Here is the html: <html> <head> <title>Test Forum</title> <link href="http://prime.programming-designs.com/test_forum/style.css" rel="stylesheet" type="text/css" /> </head> <body> <a href="http://prime.programming-designs.com/test_forum/"><img src="http://prime.programming-designs.com/test_forum//images/banner1.png" alt="" id="banner" /></a> <h1>Test Forums</h1> <hr /> <div id="navi"><div id="naviheader">Boards</div><a href="http://prime.programming-designs.com/test_forum/viewboard.php?board=0">Testing</a><br /><a href="http://prime.programming-designs.com/test_forum/viewboard.php?board=1">General Discussion</a><br /><a href="http://prime.programming-designs.com/test_forum/viewboard.php?board=2">Video Games</a><br /><a href="http://prime.programming-designs.com/test_forum/viewboard.php?board=3">Anime and Manga</a><br /><a href="http://prime.programming-designs.com/test_forum/viewboard.php?board=4">BlazBlue</a><br /><a href="http://prime.programming-designs.com/test_forum/viewboard.php?board=5">Shin Megami Tensei</a><br /><a href="http://prime.programming-designs.com/test_forum/viewboard.php?board=6">Earthbound</a><br /><a href="http://prime.programming-designs.com/test_forum/viewboard.php?board=7">Phantasy Star</a><br /><a href="http://prime.programming-designs.com/test_forum/viewboard.php?board=8">Mobile Suit Gundam</a><br /></div> <div class="postbox"><h4>CyanPrime</h4><hr />Welcome to the King's Gate BBS!</div>Page: [<a href="http://prime.programming-designs.com/test_forum/index.php?page=0">0</a>] </body> </html> Here is the CSS: @charset "windows-1252"; body{ background-color: #EEFFF8; color: #000000; text-align: center; } .postbox{ text-align: left; margin: auto; background-color: #dbfef8; border: 1px solid #82FFCD; width: 50%; margin-top: 10px; } .stickypostbox{ text-align: left; margin: auto; background-color: #F5FFFA; border: 1px solid #82FFCD; width: 50%; margin-top: 10px; } h4{ margin: 0px 0px 0px 0px; padding: 0px 0px 0px 0px; color: #9932CC; } h1{ color: #551A8B; } hr{ color: #82FFCD; background-color: #82FFCD; height: 1px; border: 0px dotted #82FFCD; } a{ color: #7F00FF; text-decoration: none; } a:hover{ color: #7F00FF; text-decoration: underline; } form{ margin: 0px auto; width: 50%; } #formdiv { background-color:#dbfef8; border:1px solid #82FFCD; } .fielddiv1{ background-color: #f9f9f9; border: 1px solid #DBFEF8; vertical-align: middle; width: 45%; float: left; } .fielddiv2{ background-color: #f9f9f9; border: 1px solid #DBFEF8; vertical-align: middle; width: 100%; } .fieldtext1{ width: 50%; background-color: #82FFCD; float: left; } .fieldtext2{ width: 100%; background-color: #82FFCD; } #replydiv{ width: 100%; background-color: #DBFEF8; margin: 10px 0 10px 0; } #admindiv{ width: 100%; background-color: #DBFEF8; margin: 10px 0 10px 0; } #navi{ width: 200px; background-color: #dbfef8; border: 1px solid #82FFCD; text-align: left; float: left; } #naviheader{ width: 100%; background-color: #82FFCD; } #submitbutton{ border: 1px solid #82FFCD; background-color: #DBFEF8; color: #000000; margin-top: 5px; width: 100px; height: 20px; } #banner{ border: 1px solid #82FFCD; } .postbar{ margin-right: 0px; margin-top: 0px; } .bannedtext{ margin: 0px 0px 0px 0px; padding: 0px 0px 0px 0px; color: #FF0000; } And here is the webpage so you can get some context (you'll notice that my "page [0]" is centered on the other boards, but not the index. http://prime.programming-designs.com/test_forum/

    Read the article

  • How to add class to selective <li> in a generated menu

    - by Vikram
    Hi I am looking for a solution to add a class to every list item <li> which has a child item with a class of <span class="separator"> and a different class to <li> with an anchor link. I use Joomla and the menu is being generated somewhat like this: <ul class="menu"> <li class="item1"><a href="<!-- link goes here -->"><span>Home</span></a></li> <li class="parent item59"><span class="separator"><span>Demo</span></span></li> <li class="item62"><a href="<!-- link goes here -->"><span>Article</span></a></li> <li id="current" class="parent active item27"><a href="<!-- link goes here -->"><span>CMS</span></a> <ul> <li class="item50"><a href="<!-- link goes here -->"><span>The News</span></a></li> <li class="item48"><a href="<!-- link goes here -->"><span>Web Links</span></a></li> <li class="item65"><span class="separator"><span /></span></li> <li class="item49"><a href="<!-- link goes here -->"><span>News Feeds</span></a></li> <li class="item66"><span class="separator"><span /></span></li> <li class="item67"><span class="separator"><span /></span></li> <li class="item68"><span class="separator"><span /></span></li> </ul> </li> <li class="item71"><span class="separator"><span>Help</span></span></li> </ul> What I want is to add class "anclink" or "seplink" to the <li> depending on their child item so that the final output looks like below. <ul class="menu"> <li class="item1 anclink"><a href="<!-- link goes here -->"><span>Home</span></a></li> <li class="parent item59 seplink"><span class="separator"><span>Demo</span></span></li> <li class="item62 anclink"><a href="<!-- link goes here -->"><span>Article</span></a></li> <li id="current" class="parent active item27" anclink><a href="<!-- link goes here -->"><span>CMS</span></a> <ul> <li class="item50 anclink"><a href="<!-- link goes here -->"><span>The News</span></a></li> <li class="item48 anclink"><a href="<!-- link goes here -->"><span>Web Links</span></a></li> <li class="item65 seplink"><span class="separator"><span /></span></li> <li class="item49 anclink"><a href="<!-- link goes here -->"><span>News Feeds</span></a></li> <li class="item66 seplink"><span class="separator"><span /></span></li> <li class="item67 seplink"><span class="separator"><span /></span></li> <li class="item68 seplink"><span class="separator"><span /></span></li> </ul> </li> <li class="item71 seplink"><span class="separator"><span>Help</span></span></li> </ul> How can I achieve this using PHP or even a jQuery solution will be fine. Kindly help.

    Read the article

  • How to add <li> using javascript?

    - by metal-gear-solid
    I want to add one more li at last but using JavaScript/jQuery for example i want to add this li at last <li><a href="#header" >Back to top</a></li> <ul id="nav"> <li><a href="#nowhere" >Lorem</a></li> <li><a href="#nowhere" >Aliquam</a></li> <li><a href="#nowhere" >Morbi</a></li> <li><a href="#nowhere" >Praesent</a></li> <li><a href="#nowhere" >Pellentesque</a></li> Here i want to add one more li using javascript </ul>

    Read the article

  • How to improve performance of map that loads new overlay images

    - by anthonysomerset
    I have inherited a website to maintain that uses a html map overlaying a real map to link specific countries to specific pages. previously it loaded the default map image, then with some javascript it would change the image src to an image with that particular country in a different colour on mouseover and reset the image source back to the original image on mouse out to make maintenance (adding new countries) easier i made the initial map a background image by utilising some CSS for the div tag, and then created new images for each country which only had that countries hightlight so that the images remain fairly small. this works great but theres one issue which is particularly noticeable on slower internet connections when you hover over a country if you dont have the image file in your browser cache or downloaded it wont load the image unless you hover over another country and then back onto the first country - i guess this is due to the image having to manually be downloaded on first hover. My question: is it possible to force the load of these extra images AFTER the page and all the other assets have finished loading so that this behaviour is all but eliminated? the html code for the MAP is as follows: <div class="gtmap"><img id="Image-Maps_6200909211657061" src="<?php echo cdnhttpsCheck(); ?>assets/wmap/a-guided-tours-map-blank.png" usemap="#Image-Maps_6200909211657061" alt="We offer Guided Motorcycle Tours all around the world" width="615" height="296" /> <map id="_Image-Maps_6200909211657061" name="Image-Maps_6200909211657061"> <area shape="poly" coords="511,134,532,107,542,113,520,141" href="/guided-motorcycle-tours-japan/" alt="Guided Japan Motorcycle Tours" title="Japan" onmouseover="if(document.images) document.getElementById('Image-Maps_6200909211657061').src='<?php echo cdnhttpsCheck(); ?>assets/wmap/a-guided-tours-map-japan.png';" onmouseout="if(document.images) document.getElementById('Image-Maps_6200909211657061').src='<?php echo cdnhttpsCheck(); ?>assets/wmap/a-guided-tours-map-blank.png';" /> <area shape="poly" coords="252,61,266,58,275,64,262,68" href="/guided-motorcycle-tour.php?iceland-motorcycle-adventure-39" alt="Guided Iceland Motorcycle Tours" title="Iceland" onmouseover="if(document.images) document.getElementById('Image-Maps_6200909211657061').src='<?php echo cdnhttpsCheck(); ?>assets/wmap/a-guided-tours-map-iceland.png';" onmouseout="if(document.images) document.getElementById('Image-Maps_6200909211657061').src='<?php echo cdnhttpsCheck(); ?>assets/wmap/a-guided-tours-map-blank.png';" /> <area shape="poly" coords="587,246,597,256,577,279,568,270" href="/guided-motorcycle-tour.php?new-zealand-south-island-adventure-10" alt="New Zealand Guided Motorcycle Tours" title="New Zealand" onmouseover="if(document.images) document.getElementById('Image-Maps_6200909211657061').src='<?php echo cdnhttpsCheck(); ?>assets/wmap/a-guided-tours-map-nz.png';" onmouseout="if(document.images) document.getElementById('Image-Maps_6200909211657061').src='<?php echo cdnhttpsCheck(); ?>assets/wmap/a-guided-tours-map-blank.png';" /> <area shape="poly" coords="418,133,412,145,412,154,421,178,430,180,430,166,443,154,443,145,438,144,433,142,430,138,431,130,430,129,425,128" href="/guided-motorcycle-tours-india/" alt="India Guided Motorcycle Tours" title="India" onmouseover="if(document.images) document.getElementById('Image-Maps_6200909211657061').src='<?php echo cdnhttpsCheck(); ?>assets/wmap/a-guided-tours-map-india.png';" onmouseout="if(document.images) document.getElementById('Image-Maps_6200909211657061').src='<?php echo cdnhttpsCheck(); ?>assets/wmap/a-guided-tours-map-blank.png';" /> <area shape="poly" coords="460,152,466,149,474,165,470,171,466,161" href="/guided-motorcycle-tours-laos/" alt="Laos Guided Motorcycle Tours" title="Laos" onmouseover="if(document.images) document.getElementById('Image-Maps_6200909211657061').src='<?php echo cdnhttpsCheck(); ?>assets/wmap/a-guided-tours-map-laos.png';" onmouseout="if(document.images) document.getElementById('Image-Maps_6200909211657061').src='<?php echo cdnhttpsCheck(); ?>assets/wmap/a-guided-tours-map-blank.png';" /> <area shape="poly" coords="468,179,475,166,468,152,475,152,482,169" href="/guided-motorcycle-tour.php?indochina-motorcycle-adventure-tour-32" onClick="javascript: pageTracker._trackPageview('/internal-links/guided-tours/map/vietnam');" alt="Vietnam Guided Motorcycle Tours" title="Vietnam" onmouseover="if(document.images) document.getElementById('Image-Maps_6200909211657061').src='<?php echo cdnhttpsCheck(); ?>assets/wmap/a-guided-tours-map-viet.png';" onmouseout="if(document.images) document.getElementById('Image-Maps_6200909211657061').src='<?php echo cdnhttpsCheck(); ?>assets/wmap/a-guided-tours-map-blank.png';" /> <area shape="poly" coords="330,239,337,235,347,226,352,233,351,243,344,250,335,253,327,255,323,249,322,242,323,241" href="/guided-motorcycle-tours-southafrica/" alt="South Africa Guided Motorcycle Tours" title="South Africa" onmouseover="if(document.images) document.getElementById('Image-Maps_6200909211657061').src='<?php echo cdnhttpsCheck(); ?>assets/wmap/a-guided-tours-map-sa.png';" onmouseout="if(document.images) document.getElementById('Image-Maps_6200909211657061').src='<?php echo cdnhttpsCheck(); ?>assets/wmap/a-guided-tours-map-blank.png';" /> <area shape="poly" coords="290,77,293,86,298,96,286,102,285,97,285,89,282,84,282,79" href="/guided-motorcycle-tour.php?great-britain-isle-of-man-scotland-wales-uk-18" alt="United Kingdom" title="United Kingdom Guided Motorcycle Tours" onmouseover="if(document.images) document.getElementById('Image-Maps_6200909211657061').src='<?php echo cdnhttpsCheck(); ?>assets/wmap/a-guided-tours-map-uk.png';" onmouseout="if(document.images) document.getElementById('Image-Maps_6200909211657061').src='<?php echo cdnhttpsCheck(); ?>assets/wmap/a-guided-tours-map-blank.png';" /> <area shape="poly" coords="357,118,368,118,369,126,345,129,338,125,338,117,342,115,348,116" href="/guided-motorcycle-tour.php?explore-turkey-adventure-45" alt="Turkey" title="Turkey Guided Motorcycle Tours" onmouseover="if(document.images) document.getElementById('Image-Maps_6200909211657061').src='<?php echo cdnhttpsCheck(); ?>assets/wmap/a-guided-tours-map-turkey.png';" onmouseout="if(document.images) document.getElementById('Image-Maps_6200909211657061').src='<?php echo cdnhttpsCheck(); ?>assets/wmap/a-guided-tours-map-blank.png';" /> <area shape="poly" coords="206,95,193,101,185,101,178,106,165,111,157,109,147,105,134,103,121,103,107,103,96,103,86,104,81,99,77,91,70,83,62,79,60,72,61,64,59,57,60,51,71,50,83,49,95,50,107,54,117,53,129,47,137,36,148,37,163,38,177,44,187,54,195,60,184,72,191,80,200,87" href="/guided-motorcycle-tours-canada/" alt="Guided Canada Motorcycle Tours" title="Canada" onmouseover="if(document.images) document.getElementById('Image-Maps_6200909211657061').src='<?php echo cdnhttpsCheck(); ?>assets/wmap/a-guided-tours-map-canada.png';" onmouseout="if(document.images) document.getElementById('Image-Maps_6200909211657061').src='<?php echo cdnhttpsCheck(); ?>assets/wmap/a-guided-tours-map-blank.png';" /> <area shape="poly" coords="61,75,60,62,60,55,59,44,51,44,43,43,36,42,28,43,23,48,17,51,15,62,19,74,27,79,19,83,16,93,35,83,43,77,50,75,55,75" href="/guided-motorcycle-tours-alaska/" alt="Guided Alaska Motorcycle Tours" title="Alaska" onmouseover="if(document.images) document.getElementById('Image-Maps_6200909211657061').src='<?php echo cdnhttpsCheck(); ?>assets/wmap/a-guided-tours-map-alaska.png';" onmouseout="if(document.images) document.getElementById('Image-Maps_6200909211657061').src='<?php echo cdnhttpsCheck(); ?>assets/wmap/a-guided-tours-map-blank.png';" /> <area shape="poly" coords="82,101,99,101,133,101,148,105,161,110,172,106,187,100,180,113,171,122,165,131,159,149,147,141,137,140,129,147,120,141,112,138,103,137,93,132,86,122,86,112,86,106" href="/guided-motorcycle-tours-usa/" alt="USA Guided Motorcycle Tours" title="USA" onmouseover="if(document.images) document.getElementById('Image-Maps_6200909211657061').src='<?php echo cdnhttpsCheck(); ?>assets/wmap/a-guided-tours-map-usa.png';" onmouseout="if(document.images) document.getElementById('Image-Maps_6200909211657061').src='<?php echo cdnhttpsCheck(); ?>assets/wmap/a-guided-tours-map-blank.png';" /> <area shape="poly" coords="178,225,180,214,175,208,174,204,178,198,174,193,167,192,157,199,158,204,164,211,167,218" href="/guided-motorcycle-tour.php?peru-machu-picchu-adventure-25" alt="Peru Guided Motorcycle Tours" title="Peru" onmouseover="if(document.images) document.getElementById('Image-Maps_6200909211657061').src='<?php echo cdnhttpsCheck(); ?>assets/wmap/a-guided-tours-map-peru.png';" onmouseout="if(document.images) document.getElementById('Image-Maps_6200909211657061').src='<?php echo cdnhttpsCheck(); ?>assets/wmap/a-guided-tours-map-blank.png';" /> <area shape="poly" coords="172,226,169,239,166,256,166,267,164,279,171,277,174,262,175,250,179,234,180,225,176,224" href="/guided-motorcycle-tours-chile/" alt="Guided Chile Motorcycle Tours" title="Chile" onmouseover="if(document.images) document.getElementById('Image-Maps_6200909211657061').src='<?php echo cdnhttpsCheck(); ?>assets/wmap/a-guided-tours-map-chile.png';" onmouseout="if(document.images) document.getElementById('Image-Maps_6200909211657061').src='<?php echo cdnhttpsCheck(); ?>assets/wmap/a-guided-tours-map-blank.png';" /> <area shape="poly" coords="199,260,194,261,187,265,184,276,183,296,170,292,168,282,174,270,174,257,177,245,180,230,190,228,205,237,199,245" href="/guided-motorcycle-tours-argentina/" alt="Guided Argentina Motorcycle Tours" title="Argentina" onmouseover="if(document.images) document.getElementById('Image-Maps_6200909211657061').src='<?php echo cdnhttpsCheck(); ?>assets/wmap/a-guided-tours-map-arg.png';" onmouseout="if(document.images) document.getElementById('Image-Maps_6200909211657061').src='<?php echo cdnhttpsCheck(); ?>assets/wmap/a-guided-tours-map-blank.png';" /> </map> </div> The <?php echo cdnhttpsCheck(); ?> is just a site specific function that gets the correct web domain/url from a config file to load resources from CDN where possible (eg all non HTTPS requests) We are loading Jquery at the bottom of the HTML if anybody wonders why it is missing from the code snippet for reference, the page with the map in question is found here: http://www.motoquest.com/guided-motorcycle-tours/

    Read the article

  • asp.net regex to find anchor tags and replace their url

    - by ace
    Hi -i'm trying to find all the anchor tags and appending the href value with a variable. for example <a href="/page.aspx">link</a> will become <a href="/page.aspx?id=2"> <A hRef='http://www.google.com'><img src='pic.jpg'></a> will become <A hRef='http://www.google.com?id=2'><img src='pic.jpg'></a> I'm able to match all the anchor tags and href values using regex, then i manually replace the values using string.replace, however i dont think its the efficient way to do this. Is there a solution where i can use something like regex.replace(html,newurlvalue)

    Read the article

  • Just a small problem regarding javscript BOM question

    - by caramel1991
    The question is this: Create a page with a number of links. Then write code that fires on the window onload event, displaying the href of each of the links on the page. And this is my solution <html> <body language="Javascript" onload="displayLink()"> <a href="http://www.google.com/">First link</a> <a href="http://www.yahoo.com/">Second link</a> <a href="http://www.msn.com/">Third link</a> <script type="text/javascript" language="Javascript"> function displayLink() { for(var i = 0;document.links[i];i++) { alert(document.links[i].href); } } </script> </body> </html> This is the answer provided by the book <html> <head> <script language=”JavaScript” type=”text/javascript”> function displayLinks() { var linksCounter; for (linksCounter = 0; linksCounter < document.links.length; linksCounter++) { alert(document.links[linksCounter].href); } } </script> </head> <body onload=”displayLinks()”> <A href=”link0.htm” >Link 0</A> <A href=”link1.htm”>Link 2</A> <A href=”link2.htm”>Link 2</A> </body> </html> Before I get into the javascript tutorial on how to check user browser version or model,I was using the same method as the example,by acessing the length property of the links array for the loop,but after I read through the tutorial,I find out that I can also use this alternative ways,by using the method that the test condition will evalute to true only if the document.links[i] return a valid value,so does my code is written using the valid method??If it's not,any comment regarding how to write a better code??Correct me if I'm wrong,I heard some of the people say "a good code is not evaluate solely on whether it works or not,but in terms of speed,the ability to comprehend the code,and could posssibly let others to understand the code easily".Is is true??

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >