Tuesday, March 17, 2020

How to add rowspan in table column if values is the same using jQuery

By using jQUery

<table border=1 id="myTable">
        <tr>
            <td>A</td>
            <td>1</td>
        </tr>
        <tr>
            <td>A</td>
            <td>2</td>
        </tr>
        <tr>
            <td>b</td>
            <td>1</td>
        </tr>
        <tr>
            <td>c</td>
            <td>1</td>
        </tr>
        <tr>
            <td>c</td>
            <td>1</td>
        </tr>
    </table>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>

<script>
    $(document).ready(function() {
       var span = 1;
       var prevTD = "";
       var prevTDVal = "";
       $("#myTable tr td:first-child").each(function() { //for each first td in every tr
          var $this = $(this);
          if ($this.text() == prevTDVal) { // check value of previous td text
             span++;
             if (prevTD != "") {
                prevTD.attr("rowspan", span); // add attribute to previous td
                $this.remove(); // remove current td
             }
          } else {
             prevTD     = $this; // store current td 
             prevTDVal  = $this.text();
             span       = 1;
          }
       });
    });
</script>

Thursday, March 5, 2020

jQuery Vertical Scrolling Web Ticker Plugin - vticker

vticker is a simple jQuery plugin for creating a vertical scrolling ticker widget with one line of javascript code. Items can be paused when the mouse hovers over an item.

Basic Usage:

1. Inlcude jQuery library and jQuery vticker plugin on the web page
2<script src="jquery.vticker.js"></script>
2. Create the html for the web ticker
1<div id="example">
2<ul>
3    <li>Item 1</li>
4    <li>Item 1</li>
5    <li>Item 3</li>
6    ...
7</ul>
8</div>
3. Initialize the plugin.
1<script>
2$(function() {
3$('#example').vTicker();
4});
5</script>
4. Available options.
01<script>
02$(function() {
03$('#example').vTicker({
04speed: 700,
05pause: 4000,
06showItems: 1,
07mousePause:true,
08height: 0,
09animate:true,
10margin: 0,
11padding: 0,
12startPaused:false});
13});
14</script>



Source: https://www.jqueryscript.net/text/jQuery-Vertical-Scrolling-Web-Ticker-Plugin-vticker.html

How to change the PHP version for subfolders or subdomains

  How to change the PHP version for subfolders or subdomains Setting a specific PHP version for a specific websites, subfolders or subdomain...