Search Results

Search found 60 results on 3 pages for 'danit'.

Page 2/3 | < Previous Page | 1 2 3  | Next Page >

  • Resize div on browser resize

    - by danit
    I have a <div> which I want to display full screen, but I also need to incorporate a 60px high <div> and a 10px high <div> at the top of the document. The size of the main div will need to re-size as the browser window is re-sized to keep it full screen. <div id="div1" style="height: 60px"> </div> <div id="div2" style="height: 10px"> </div> <div id="fullscreen"> </div> So: fullscreen height = document size - (#div1 + #div2) On re-size recalculate the above value.

    Read the article

  • Get the Title of all posts

    - by danit
    Im using Wordpress, Im also creating posts via XMLRPC based on an RSS feed that is added to periodically. What I want is to read all post titles, compare those against the RSS feed, then only post to Wordpress where the post titles dont exist. I'm trying this code: <?php define('WP_USE_THEMES', false); require('../wp-load.php'); query_posts('showposts=-1&author=1&post_status=publish'); ?> <?php while (have_posts()): the_post(); ?> <?php the_title(); ?> <?php endwhile; ?> This gets all titles from published posts, I then need to do the same to get the draft posts. I need to write these title's to an array?

    Read the article

  • Extend a function to support more items

    - by danit
    Im trying to use this function with Wordpress: http://www.wprecipes.com/post-on-your-wordpress-blog-using-php When trying to add extra options im hitting problems: Using the Wordpress Codex here: http://codex.wordpress.org/Function_Reference/wp_insert_post Specifically trying to add: 'post_date' => [ Y-m-d H:i:s ] //The time post was made. 'post_excerpt' => [ <an excerpt> ] //For all your post excerpt needs. Can anyone add them to the function for me?

    Read the article

  • Toggle image based on cookie value

    - by danit
    Im using a couple of JS functions to set a cookie named 'visible' with the value of either yes or no. Essentially Im using these values to decide if a <div> is visible or hidden. I've only just added the cookie, previously I had been using two images 1. Show 2. Hide as a button to hide and show the <div> like this: HTML: <img class="show" title="Show" alt="Show" src="images/show.png" /> <img class="hide" title="Hide" alt="Hide" src="images/hide.png" /> JQUERY: $("#tool").click(function() { $(".help").slideToggle(); $("#wrapper").animate({ opacity: 1.0 },200).slideToggle(200, function() { $("#tool img").toggle(); }); }); However I have now added the Cookie into the mix: $("#tool").click(function() { if(get_cookie('visible')== null) { set_cookie('visible','no'); } else { delete_cookie('visible'); } $(".help").slideToggle(); $("#wrapper").animate({ opacity: 1.0 },200).slideToggle(200, function() { $("#slider img").toggle(); }); }); So the .toggle() no longer matches the state of the <div> When the cookie value = no the show.png should be visible When the cookie value = yes then the hide.png should be visible Can anyone suggest how i can ammend this?

    Read the article

  • Javascript Cookie Function not working for Domain

    - by danit
    Here are the functions Im using: Set Cookie: function set_cookie ( name, value, exp_y, exp_m, exp_d, path, domain, secure ) { var cookie_string = name + "=" + escape ( value ); if ( exp_y ) { var expires = new Date ( exp_y, exp_m, exp_d ); cookie_string += "; expires=" + expires.toGMTString(); } if ( path ) cookie_string += "; path=" + escape ( path ); if ( domain ) cookie_string += "; domain=" + escape ( domain ); if ( secure ) cookie_string += "; secure"; document.cookie = cookie_string; } Read Cookie: function get_cookie ( cookie_name ) { var results = document.cookie.match ( '(^|;) ?' + cookie_name + '=([^;]*)(;|$)' ); if ( results ) return ( unescape ( results[2] ) ); else return null; } Delete Cookie: function delete_cookie ( cookie_name ) { var cookie_date = new Date ( ); // current date & time cookie_date.setTime ( cookie_date.getTime() - 1 ); document.cookie = cookie_name += "=; expires=" + cookie_date.toGMTString(); } The Jquery I use to construct the cookie: if(get_cookie('visible')== 'no') { $("#wrapper").hide(); $(".help").hide(); $("#slid .show").show(); $("#slid .hide").hide(); } else { $("#slid .show").hide(); $("#slid .hide").show(); } $("#slider").click(function() { if(get_cookie('visible')== null) { set_cookie('visible','no', 2020, 01,01, '/', 'domain.com'); } else { delete_cookie('visible'); } $(".help").slideToggle(); $("#wrapper").animate({ opacity: 1.0 },200).slideToggle(200, function() { $("#slid img").toggle(); }); }); Im trying to set the cookie for all pages that exist under domain.com with the path '/'. However using these functions and jQuery it doesn't appear to be working, any anyone give me an idea of where im going wrong?

    Read the article

  • Twitter Favorites and more than 20

    - by danit
    Im using curl to fetch my Twitter favorites: <?php $username = "bob"; $password = "password"; $twitterHost = "http://twitter.com/favorites.xml"; $curl; $curl = curl_init(); curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 2); curl_setopt($curl, CURLOPT_HEADER, false); curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_USERPWD, "$username:$password"); curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); curl_setopt($curl, CURLOPT_URL, $twitterHost); $result = curl_exec($curl); curl_close($curl); header('Content-Type: application/xml; charset=ISO-8859-1'); print $result; ?> However this only fetches the last 20 favorites, not all of them. If i amend this line: $twitterHost = "http://twitter.com/favorites.xml"; And change it to: $twitterHost = "http://twitter.com/favorites.xml?page=2"; I can get the next set of 20 favorites. There doesnt appear to be anyway, using the Twitter API, to find out how many pages of favorites there are. As such can anyone suggest the best way to get all favorites? Or if this is not possible, get all the Tweets for a date range?

    Read the article

  • Help a newbie with a PHP Function

    - by danit
    I want to use this function: http://www.frankmacdonald.co.uk/php/post-to-wordpress-with-php.html Its used to post to Wordpress using XMLRPC, can anyone give me the basics for using this function and maybe a brief over view? I want to learn how functions work and how to use them.

    Read the article

  • Remove class when move to next menu item

    - by danit
    I have a simple nav made up of the following HTML; <div class="inner"> <div class="button"><img class="portal" src="images/portalbutton.png" /></div> <a href="#"><div class="prod_description">&nbsp;</div></a> </div> There are a number of items (All set to float left along side each other) to make up a nav bar. When I hover over .button and/or .prod_description I want the .inner <div> to have the class .hover added to it. This is so I can set a background image around the whole thing (Kind of like highlighting the nav item). I only then want to remove .hover when another .button or .prod_description is hovered over, in which case this nav item takes the .hover class.

    Read the article

  • Random selection in jQuery

    - by danit
    Im using the following function to hide a series of forms on a page: $('.ask').toggle(function() { $(this).text('-').next('.addtitle').slideDown('fast'); }, function() { $(this).text('+').next('.addtitle').slideUp('fast'); }); There can be anything from 0 to 5 forms on the page all with the class .ask What I want to be able to do is to select one form NOT to hide, so the jQuery needs to hide all put one of the forms on the page randomly. How can I achieve this?

    Read the article

  • setting a cookie to be used across web apps

    - by danit
    I have a number of apps all under the same domain: E.g.: app1.overflow.com app2.overflow.com/email app3.overflow.com/home I setting using these functions: http://www.elated.com/articles/javascript-and-cookies How can I setup the cookie so that It can be read across all of the applications? I dont seem to be able to get this to work?

    Read the article

  • Strange text when converting XML array to XML

    - by danit
    Im using the answer to this question to convert an array of XML to a single XML output: http://stackoverflow.com/questions/2554671/output-array-of-xml-to-plain-xml Im using the simpler solution of the two there (Marked as the answer) It all works for me, however at the start of the output I get: string(109960) " Can anyone shed any light on this? Output here: http://bit.ly/aoA3qY

    Read the article

  • HTML Setting Active with different background colour

    - by danit
    Here is my HTML List: <ul id="navlist"> <li class="item1"><a href="#">One</a></li> <li class="item2"><a href="#">Two</a></li> <li class="item3"><a href="#">Three</a></li> <li class="item4"><a href="#">Four</a></li> <li class="item5"><a href="#">Five</a></li> <li class="item6"><a href="#">Six</a></li> </ul> Each .itemx has a different background colour, so I need the active state to take into account the class. Obviously something like: <li class="item6" id="active"><a href="#">Six</a></li> #active.item6 { background: red; } Would work but IE6 doesnt like chained items in CSS so doesnt work when other items are set out in the CSS. Can I do this with jQuery where each item has a different background colour when 'active?

    Read the article

  • Whats wrong with this function

    - by danit
    I cant work out which brackets are in the wrong place and where and now im completely lost: $("#slid").click(function() { $("#div1").animate({ top: "25px",}, 300 },function() { $("#div1").animate({ top: "85px",}, 300 }); }); Can anyone help?

    Read the article

  • Javascript - Simple form script to hide/show fields

    - by danit
    Im looking for a simple script in javascript that i can extend, at a basic level Im looking to show 1 field based on which option from a <select> the user chooses. <select id="options"> <option value="spoon">Spoon</option> <option value="form">Fork</option> </select> if select=spoon { <input>enter your favorite soup</input> } else { <input>Your gonna need a knife</input> } Simple JS is the key!

    Read the article

  • jquery animate - dead simple

    - by danit
    All I want to do is on .click() is .animate #slip, essentially Im changing the css at the moment from top: 10px to top: 0px Instead of it being quite clunky i'd like to animate the movement on the change of CSS. Currently use .toggleClass to achieve this: $("#div1").click(function() { $("#div2t").toggleClass('min'); });

    Read the article

  • jQuery .click() .toggle() - change display and swap character

    - by danit
    Here is my jQuery: $('.ask').click(function() { $('.addtitle').slideToggle('fast', function() { // Animation complete. }); }); And my HTML: <p class="ask">+</p> <div class="addtitle"> <p>Give your Idea a great title</p> <form name="input" action="#" method="get"> <input id="title" type="text" name="title" /> <input id="go" type="submit" value="Go" /> </form> </div> I have multiple .ask div's on the page and I only want it to effect the .next() div named .ask rather than all div's named .ask. I also want to .toggle() the '+' character to '-' Can anyone assist?

    Read the article

  • jQuery animate Toggle

    - by danit
    Here is my code so far: $(document).ready(function(){ $("#slider").click(function() { $("#insight").animate({ top: "25px",}, 300, function() { $("#insight").animate({ top: "89px",}, 300); }); }); }); I want this to act like .toggle(), where by on click #div1 slides up to top:25px and then stops, but when clicked again slides down to top:89px. Can anyone expand the function above to achieve this?

    Read the article

  • jQuer - slideToggle() and Toggle Text

    - by danit
    I have a contact form that can be hidden using .slideToggle() but I want the tab used to Toggle the form to change text based on wether the form is in view or hidden. Here is the jQuery: $("#slider").click(function() { $("#form_wrap").animate({ opacity: 1.0 },200).slideToggle(); }); I want the text of #form_wrap to read 'Hide' then 'Show'. Any help appreciated!

    Read the article

  • Hide and Show content based on Cookie value

    - by danit
    Here is my Jquery: $("#tool").click(function() { $(".chelp").slideToggle(); $("wrapper").animate({ opacity: 1.0 },200).slideToggle(200, function() { $("#tool img").toggle(); }); }); When you click #tool img #wrapper is hidden along with .chelp. I need to control this with a cookie, so when the user hides #wrapper it remains hidden on all pages or when they re-visit the page. I know there is a jQuery Cookie plugin, but I'd like to do this with plain Javascript rather then including another plugin. Can anyone tell me how i can build in it in plain javascript and merge with the JQuery to create a cookie, then check the cookie each time the page loads to see if #wrapper should be hidden or displayed?

    Read the article

< Previous Page | 1 2 3  | Next Page >