Jump to content

eiranix

Members
  • Posts

    66
  • Joined

  • Last visited

Everything posted by eiranix

  1. It was a stacking order problem. I found that the only to fix it was setting position to relative to the upper and position initial for the lower as well as setting z-index values. For some reason it was only a problem in IE.
  2. Edit: somehow posted on the wrong thread...
  3. I can't seem to recreate the problem, so maybe it's something else. I will have to take a copy of my page and try to simplify it down to the point where I see more clearly where the problem might be coming from. The reason why I thought it was a table-cell thing is because temporarily changing all the table divs to block seemed to fix it...
  4. Ok so I've discovered how to make it work The Methods on the site say to write: $('input[name="example"]').textrange('replace', 'some text'); But I found the demo did it slightly differently, so the way it works is: $('#fred').textrange('replace', 'apples');
  5. I have a div with display:table-cell and inside it I have another div that I want to overflow it. I thought it was working fine until I tested it in IE, where the inner div is hidden. It is not hidden in firefox and IE8 but in IE9+ it behave differently. Is this something I can fix with extra CSS or is it just not possible with the newer IE's?
  6. The reason I thought it was my problem is that there is an example page that works just fine with no errors. The example page and my basic test page are local and using the same js links. I was using the console in firefox so maybe that makes a difference where the line number is concerned? For more info, this is my test page: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><script type="text/javascript" src="jquery-1.11.1.min.js"></script><script type="text/javascript" src="jquery-textrange.js"></script><script>function replaceMe() { $('input[name="fred"]').textrange('replace', 'apples');};</script></head><body><textarea name="fred" id="fred" ></textarea><input style="height:40px;" type="button" id="rep" name="rep" value="Click to Replace" onclick="replaceMe();"/></body></html>
  7. I'm not that familiar with jQuery so I was wondering if someone could point out what I'm doingn wrong? Attemping to use the jQuery Textrange plugin found here: https://github.com/dwieeb/jquery-textrange When I try to simply use the replace feature: function replaceMe() { $('input[name="fred"]').textrange('replace', 'apples');}; I am getting an error in the console saying "TypeError: invalid 'in' operand this[0] jquery-textrange.js:192" Any guidance is appreciated...
  8. Great thanks. I'm new to php so I like to check things sometimes!
  9. I want to include a file on all the pages of my site, but some of those pages are in subfolders. I would like to get around putting ../ on some pages and not others so I used an if statement: <?php if (file_exists('menu.php')) { include 'menu.php'; } else { include '../menu.php'; }; ?> So my question is, is this the best way to do it? Any danger that this won't work? I have tried using $_SERVER['SITE_HTMLROOT'] without success,
  10. Ah, thats an interesting way to do it, thanks for the insight A couple of questions: Does an absolute item always position its left to a static parent's left as long as there is no left/right value set for it? Is there any reason you write #content div:after instead of just #content:after?
  11. Ok I have come up with a working solution using display:table. Is this a valid/supported way to do it? Has anyone got a better way to do it? (maybe with less divs involved?) <div id="container"> <div id="top"><div id="header"></div></div> <div id="middle-row"> <div id="middle-cell"> <div id="content"> <p> Test </p> </div> </div> </div> <div id="bottom"><div id="footer"></div></div></div> html, body { margin:0; height:100%;}#container { width:100%; height:100%; display:table;}#top { height:100px; display:table-row;}#header { background-color:green; display:table-cell;}#middle-row { display:table-row;}#middle-cell { display:table-cell; height:100%;}#content { height:100%; max-width:940px; padding:10px; margin:0 auto; background-color:red;}#bottom { display:table-row; height:40px;}#footer { display:table-cell; background-color:blue;}
  12. Thanks for the explaination, I see what you mean. It makes a nice sticky footer but it still doesn't make the content div full height... I have added more to your verison and made it -almost- work how I intended. The problem with this is the content div does not expand to fit it's contents <body><div id="container"> <div id="header"></div> <div id="content"><div id="inner-content"><p>Test</p></div></div></div><div id="footer"></div> html, body { margin:0; height:100%;}#container { height:100%;}#header { position:relative; background-color:green; height:100px; z-index:1;}#content { position:relative; overflow:auto; /* stops the bottom overflow */ height:100%; width:960px; margin:0 auto; background-color:red; margin-top:-100px;}#footer { position:relative; height:40px; margin-top: -40px; background-color:blue;}#inner-content { margin:100px 0 40px 0;}
  13. Sorry, to be more specific - I'm not using the html footer tag. I am trying to use a div as the footer for better support. Can you explain what I need to add to make the content div always extend down to the footer? html looks like this: <div id="container"> <div id="header"></div> <div id="content"></div> <div id="footer"></div></div> Css: html, body { margin:0; height:100%;}#container { position:relative; min-height:100%;}#content { position:relative; width:960px; min-height:800px; margin:0 auto;}#footer { position: absolute; height:40px; bottom:0px;}
  14. eiranix

    Redirecting?

    I have just found out about using an .htaccess file... Solution was to add: ErrorDocument 404 http://myurl.com Redirects every bad link back to the home page.
  15. I have a header and a footer that is 100% width. The footer sticks to the bottom when there is a high screen resolution. The Content area is a fixed width and I would like to have it extend down to the footer on large screens even if the content is short, how can I achieve this?
  16. eiranix

    Redirecting?

    Is there an easy way to redirect all links people try using that end with .html to go to index.php?
  17. Yeah I thought I might have been putting it in wrong, but I have tried several ways to put the same character in and it breaks the script every time. I'll try on the jpages issues/suggestions board and see if anyone knows...
  18. Can anone tell me how I can put the < and > characters in this script? For the 'previous' entry I want to use '<' but any way I put it in results in the entire script not working I have tried using "&lt" and "<" and "<" with no success... (This is a part of the jpages plugin) var name = "jPages", instance = null, defaults = { containerID: "", first: false, previous: "<", next: ">", last: false, links: "numeric", // blank || title startPage: 1, perPage: 6, midRange: 3, startRange: 1, endRange: 1, keyBrowse: false, scrollBrowse: false, pause: 0, clickStop: false, delay: 50, direction: "forward", // backwards || auto || random || animation: "", // http://daneden.me/animate/ - any entrance animations fallback: 400, minHeight: true, callback: undefined // function( pages, items ) { } };
  19. I made some adjustments, it now removes the blank lines with trim. Is this the correct way to set up a function?: <?phpfunction list_maker($file){$text = file_get_contents($file); // get contents of file$text_contents = explode("n", $text); //Explode new lines to arrayforeach($text_contents as $content) { if(trim($content) !== '') { // removes blank lines $check_url = parse_url($content); //if its a URL add the <a ... if(isset($check_url['host'])) { $content = '<br/><a href="'.$content.'">'.$content.'</a>'; } //Add <li> to all content and pack them back to array $output[] = '<li>'.$content.'</li>'; };};$string = implode("n", $output); //Implode array back to stringecho str_replace("</li>n<li><br/>", "<br/>n", $string);//combines links with <li> above}?><p>This is list 1:</p><ul><?php echo list_maker('list1.txt');?></ul><p>This is list 2:</p><ul><?php echo list_maker('list2.txt');?></ul>
  20. Another thing - Is it possible to run this same script several times on one page with different text files? I could repeat the whole script each time of course, but I thought there might be a way to have the full script once at the top then have a short line that can call it with a file name variable... (like what you'd do with a javascript function)
  21. No, the ($content !== null) still includes the blank lines?
  22. Thanks for the reply. I combined some elements from my first attempt with yours and it seems to be working great now. Are there any problems with this?: <?php$text = $text = file_get_contents('list.txt'); // get contents of file$blankless = preg_replace("/[rn]+/", "n", $text); // remove blank lines$text_contents = explode("n", $blankless); //Explode new lines to array//Run a foreach to manipulate an array valueforeach($text_contents as $content) { $check_url = parse_url($content); //if its a URL add the <a ... if(isset($check_url['host'])) { $content = '<br/><a href="'.$content.'">'.$content.'</a>'; } //Add <li> to all content and pack them back to array $output[] = '<li>'.$content.'</li>';}$string = implode("n", $output); //Implode array back to stringsecho str_replace("</li>n<li><br/>", "<br/>n", $string);//combines links with <li> above?>
  23. I know little about php so bear with me... I have put together this code from a few examples online that almost does what I want. <?php$text = file_get_contents('list.txt'); // get contents of file$html = preg_replace('/s(w+://)(S+)/', '<a href="12">12</a>', $text);// replace URLs with <a href...> elements$html = preg_replace("/[rn]+/", "n", $html); // remove blank lines$html = preg_replace("/^/m", "<li>", $html); // add <li> to start of each lineecho str_replace("n", "</li>n", $html); // add </li> to end of each line and output?> It takes a plain text file and turns each line into an html list item as well as converting url's to html links. Can anyone tell me - 1) Is this a valid way to do it (any mistakes)? 2) If there is a url in the txt file and its on its own line, it'll end up being it's own list item. How can i join it to the list item above it? for example, my text file is this: list item 1list item 2http://www.google.comlist item 3list item 4list item 5 and I want the url to be a part of 'list item 2' but with a <br/> so it looks like this: list item 1 list item 2http://www.google.com list item 3 list item 4 list item 5
  24. It appears that even with width=device-width and initial-scale=1 the scale is still not true to the device resolution. A device at 480px wide will display the page at 320px wide, which is a bit too close in. Is there any solution to this?
  25. Yeah... scratch that, it didn't look like it worked to start with. Typo in my path. But thanks again it is just what I was looking for. I haven't used root-relative links before.
×
×
  • Create New...