added some crossbrowser support and adjusted sliding