Jump to content

toolman

Members
  • Posts

    210
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

toolman's Achievements

Advanced Member

Advanced Member (4/5)

0

Reputation

  1. Hi there, Thank you for the reply. Thanks, that works great with the text if its already set. However, If I try to pull it through using the WordPress function I have, It outputs the whole text. This is what I tried: <?php $text = wpjm_the_job_description(); $words = array_slice(explode(' ', $text), 0, 15); echo join(' ', $words) . '…'; ?>
  2. Hi, Thanks for the replies. I'm happy with the one I have above, so if there is a way I can truncate that, that would be ideal. With regards to phpmillion, it is outputting everything, but what I meant was the code I have is not doing anything, so I guess I have something wrong with it. I am happy the character count, but ideally word count would be better.
  3. Hi there, I'm trying to truncate some text by 15 words which is then followed by a "..." This is the line that outputs all the text: wpjm_the_job_description(); I've tried this, but nothing is happening. <?php $desc=wpjm_the_job_description(); echo substr($desc, 0, 15); ?> Any ideas what I have wrong? Thanks
  4. Hi there, I have the following select: <select name="place"> <option value="place1">Place 1</option> <option value="place2">Place 1</option> <option value="place3">Place 1</option> <option value="place4">Place 1</option> </select> What I would like to do is display another select dropdown if either option "place2", "place3" or "place4" is selected. How would I do this? Thanks!
  5. Hi, I don't have PHP, I only want to work with jQuery :/ I've managed to create this: var urls = window.location.href; $("a").each(function() { var $this = $(this); var _href = $this.attr("href"); $this.attr("href", _href + urls.substring(urls.lastIndexOf('/') + 1)); }); This sort of works on the following code: <a href="/sub/page.shtml" onClick="window.open('/sub/page.shtml', ''); return false; trackOutboundLink(this, 'Outbound Links', 'my link');" >Link</a> However, the window.open event causes the link to lose the appended URL. How can I apply the above to append the URL in the window.open? Thanks
  6. Hi there, I have the following URL: http://www.website.com/?code=code1&ref=myref&utm_source=email&utm_medium=direct&utm_campaign=test What I would like to do is add the ?code=code1&ref=myref&utm_source=email&utm_medium=direct&utm_campaign=test part of the URL to specific links on the page based on their ID's. The ?code= and ?ref= are dynamic, so I would need to get the URL as a dynamic URL. What would be the best way to do this? Thanks!
  7. The website has over 100,00 pages - not all have a global library with jQuery included, so I wanted to see if I could use native JavaScript. Initially I thought jQuery was included on all pages, but it's not. I have a JS include globally, but because the website is so old, I need to work with something without jQuery if possible.
  8. Thanks for the reply. After posting this, I realised, I may not have jQuery cookie plugin installed. Basically, a page loads with a URL for example of: http://www.website.com/cookie_name This then inserts a cookie called cookie_name with a value of cookie_value E.G: http:www.website.com?agent=john This then gives the cookie "cookie_name" a value of "john" What I would like to do is to use an if statement based on if the cookie has a value of "john" to do something; replace a one line of HTML. Not sure if that helps?
  9. Hi there, I have a page which displays some text based on a cookie that is set. What I would like to do is to over-ride that text/html by using an if statement based on the cookie value. I have the following, but not having any luck with it: if ($.cookie('cookie_name')=='cookie_value'){ alert("true"); $("#box").html("new text"); } Ideally, I'd like to use JavaScript rather than jQuery due to limitations. Any ideas? Thanks!
  10. Hi there, I have the following code: <select id="location" name="drop"> <option value="loc1">Location 1</option> <option value="loc2">Location 2</option> <option value="loc3">Location 3</option> <option value="loc4">Location 4</option> <option value="loc5">Location 5</option> <option value="loc6">Location 6</option> <option value="loc7">Location 7</option> </select> <select id="second" name="term"> <option value="OPT1">Option 1</option> <option value="OPT2">Option 2</option> <option value="OPT3">Option 3</option> <option value="OPT4">Option 4</option> </select> What I would like to do is to show the second select field only when "Location 5" is selected in the first drop down. How would I do this? Thanks
  11. Hi there, I have a form which I would like to append a variable to the end of the URL after it is submitted. To do this, I would like to use a select drop down: <select id="ddl" name="term"> <option selected="selected" value="all">Please Select...</option><option value="1">Option 1</option><option value="2">Option 2</option><option value="3">Option 3</option><option value="4">Option 4</option><option value="5">Option 5</option> </select> The variable I would like to add to the end of the URL would be: &option=1, &option=2 etc depending on the selected item. How would I go about doing this? Thanks!
  12. Thanks this works when the user chooses another option and then selects the default, but is there a way to create the alert if the default value is left when submitting the form?
  13. Hi there, I have the following line which insets an option to the top of a select. What I would like to do is to check if this value is left as the default and return an alert or a validation message asking the user to select an option apart from the default. $("select[name='ap']").prepend("<option value='' selected='selected'>Default option</option>"); What would be the best way to do this? Thanks
  14. toolman

    z-index issue

    Hi, I have the following code: <div class="cover" style="position: absolute; z-index: 200"></div> <div class="slide"> <img src="image.png" style="position: absolute; z-index: 50" /> <h1 style="position: absolute; z-index: 500">heading</h1> </div> I would like the <h1> to appear on top of the image and above the <div class="cover"> For some reason, it is not appearing on top of the "cover". Any ideas why?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.