Гость
Целевая тема:
Создать новую тему:
Автор:
Форумы / HTML, JavaScript, VBScript, CSS [игнор отключен] [закрыт для гостей] / Код не работает в IE8 / 2 сообщений из 2, страница 1 из 1
26.08.2015, 13:39
    #39036352
son456
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Код не работает в IE8
Здравствуйте! Нужно в альбоме иметь возможность удалять фотографии. Данная возможность работает в GoogleCrom, в mazile работает только с firebug, а в IE8 совсем не работает. Привожу код.
index.php
Код: html
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
<!doctype html>
<html>
<head>
   <meta charset=utf-8>
   <title>Слайд-шоу</title>
   <link href="css/1.css" rel="stylesheet" type="text/css"/>
   <SCRIPT Language="Javascript">
   function printit()
  {
     window.print();
   }
  </script>
   <style>
 
  </style>
</head>
<body>
<div id="bt_Ctr" style=''>
  <form>
  <input TYPE="button" CLASS="for" VALUE="Распечатать страницу!" onClick="printit()">
  </form>
  <br/>
</div>
<div id='suggesstion-box'></div>
<div class='view'>
<ul>
<?php
$dir_hndl = opendir('./img');
while (false !== ($name = readdir($dir_hndl)))
{
        if ($name == '..')
      {
            continue;
        } elseif ($name == '.')
      {
            continue;
        }
      ?> <li><img src='<?php echo 'img/'.$name;?>' width='900px' height='1000px' ></li><?php
}
closedir($dir_hndl);?>
 
 
</ul>
</div>
<div id='bt_Show'>
<button id='prev'>Назад</button>
<button id='next'>Вперед</button>
<button id='del'>Удалить фото!</button>
</div>
<script src="lib/jquery.js" type="text/javascript"></script>
<script src="lib/slide-show.js"></script>
 
</br></br></br></br>
</body>
</html>


slide-show.js
Код: javascript
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
(function($){
var viewUL=$('div.view').css('overflow','hidden').children('ul');
imgs=viewUL.find('img'),
imgW=imgs[0].width,
imgsLen=imgs.length,
totalImgsW=imgW*imgsLen,
current=1;
 
$('#bt_Show').show().find('button').on('click',
function(){
//console.log($(this));
var direction=$(this).attr('id');
//console.log(direction);
var position=imgW;
//(direction === 'next') ? ++current : --current;
var imgSrc=imgs[current-1].src;
if(direction === 'del')
{
  //var src= $('img').attr('src');
  var HID = imgSrc.match(/img\/[0-9.\jpg]+/i);
  //var HID = src.match(/[0-9]+/i);
  $.ajax({
  type: "POST",
  url: "DelScan.php",
  data:
  'HID='+HID
  ,
  success: function(data)
  {
    $("#suggesstion-box").show();
    $("#suggesstion-box").html(data);  
 
  }
});
   //direction = 'next'
   location.reload();
}
if(direction === 'next')
{
  ++current;
}
if(direction === 'prev')
{
  --current;
}
if(current === 0)
{
  current=imgsLen;
  direction='next';
  position=totalImgsW-imgW;
}
else if(current-1===imgsLen)
{
  current=1;
  position=0;
}
doit(viewUL,position,direction);
});
function doit(container,position,direction)
{
var sign;
if(direction && position !==0)
{
 
  //sign=(direction === 'next') ? '-=' : '+=';
 if(direction === 'next')
 {
   sign='-=';
 }
 if(direction === 'prev')
 {
   sign='+=';
 }
}
container.animate({
'margin-left' : sign ? (sign+position) : position
});
}
})(jQuery);


DelScan.php
Код: php
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
<?php
 
include_once "Classes/class.Security.php";
$secur = new Security();
if(isset($_POST["HID"]))
{
  if(!empty($_POST["HID"]))
  {
   if(file_exists($secur->sanitizeString($_POST['HID'])))
   {
   unlink($secur->sanitizeString($_POST['HID']));
   }
   else
   {
     echo $secur->sanitizeString($_POST['HID']);
   }
  }
}
?>
...
Рейтинг: 0 / 0
26.08.2015, 14:42
    #39036423
son456
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Код не работает в IE8
1.css
Код: css
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
#bt_Show{margin-top:1em;}
 .view
    {
      width:900px;
      height:1100px;
      overflow:scroll
    }
    .view ul
    {
      padding-left:0px;
      list-style:none;
      width:10000px;
    }
    .view li{margin-left:0px;padding-left:0px;float:left}
    #bt_Show button
    {
      padding:1em;
      cursor:pointer
    }
...
Рейтинг: 0 / 0
Форумы / HTML, JavaScript, VBScript, CSS [игнор отключен] [закрыт для гостей] / Код не работает в IE8 / 2 сообщений из 2, страница 1 из 1
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]