如果div有一个数字,则添加类宽度jQuery

时间:2014-08-11 17:30:18

标签: jquery class if-statement numbers add

我想在我的div中添加一个数字。

<div class="stock">15 in stock</div>

宽度jQuery我想要添加类“低库存”如果&gt; = 15

有你的想法

1 个答案:

答案 0 :(得分:0)

刚刚发现这个问题,请你走了:

<强> HTML

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.ServiceModel;
using System.ServiceProcess;
using System.Configuration;
using System.Configuration.Install;
using WindowsService;

namespace WS
{

    [ServiceContract(Namespace = "http://WS")]
    public interface INewsReader
    {

    }


    public class NewsReaderService : INewsReader
    {

        public NewsReaderService()
        {
            var config = new Config();

            var scheduled = new Schedule(config);
            scheduled.ExecuteScheduledEvents();
            while (true)
            {
                System.Threading.Thread.Sleep(1000);
                int i = 0;
            }
        }
    }

    public class NewsReaderWindowsService : ServiceBase
    {
        public ServiceHost serviceHost = null;
        public NewsReaderWindowsService()
        {

            ServiceName = "NewsReaderWindowsService";
        }

        public static void Main()
        {
            ServiceBase.Run(new NewsReaderWindowsService());
        }


        protected override void OnStart(string[] args)
        {
            var thread = new System.Threading.Thread(() =>
            {
                while (true)
                {
                    int i = 0;
                    System.Threading.Thread.Sleep(1000);
                }
            });
            thread.Start();

            serviceHost = new ServiceHost(typeof(NewsReaderService));


            serviceHost.Open();

        }

        protected override void OnStop()
        {

        }
    }


    [RunInstaller(true)]
    public class ProjectInstaller : Installer
    {
        private ServiceProcessInstaller process;
        private ServiceInstaller service;

        public ProjectInstaller()
        {
            process = new ServiceProcessInstaller();
            process.Account = ServiceAccount.LocalSystem;
            service = new ServiceInstaller();
            service.ServiceName = "NewsReaderWindowsService";
            Installers.Add(process);
            Installers.Add(service);
        }
    }
}

<强> JS

<div class="stock">15 in stock</div>